Web development django (1) - PowerPoint PPT Presentation

About This Presentation
Title:

Web development django (1)

Description:

We are one of the most reputed Training institutes in Ahmedabad, Pune & Navi Mumbai. We are providing, Live Project Training in All Programming Languages C, PHP, Java, Android, Python, Data Science, Software Testing, & Graphic Designing. We are Providing Training classes in with Live Projects. We have a team of professional Trainers, mentors, and industry experts who Continuously struggling to survey the current market and preparing India s youth to contribute to the growth of our country. After Training, We provide 100% assured job assistant after the training. Our Goal is your Career is our Commitment. We Have Unlimited Combinations to create Bright Careers. Our Culture is No Theory, No Books – PowerPoint PPT presentation

Number of Views:0
Slides: 48
Provided by: codingcloud
Tags:

less

Transcript and Presenter's Notes

Title: Web development django (1)


1
(No Transcript)
2
Web framework
  • What is a Web Framework?

A web framework is a server-side application
framework , that is designed to support the
development of dynamic websites web
applications web services and resources

3
More about web Framework
  • A Python web framework is a code library,
  • that makes the life of a web application
    developer much easier
  • for building flexible, scalable and maintainable
    web applications.
  • A web development framework is a set of resources
    and tools for software developers to build and
    manage web applications, web services and
    websites.

4
Why Django ?
  • Tight Integration between Components
  • Object-Relational Mapper (ORM)
  • Automatic Administration Interface Multi-Lingual
    Support

5
Introduction to Django framework.
  • There are following frameworks in Python.
  • Django
  • CherryPy
  • pylons
  • Flask
  • Bottle
  • Pyramid
  • Cubic Web
  • GAE framework

6
What is Django Framework ?
  • Django is basically a high-level Python web
    application framework that enables the rapid
    development of web applications.
  • It achieves so with pragmatic, much cleaner
    design in comparison of other frameworks.
  • Django takes care of the difficult stuff so that
    you can concentrate on building your web
    applications.

7
MVT Pattern
  • How does Django Work?
  • Django follows the MVT design pattern (Model
    View Template).
  • MVT stands for Model View Template.
  • MVT architecture is the software design pattern
    used by the Django web framework.

8
Model
  • In Django, the data is delivered as an Object
    Relational Mapping (ORM)
  • which is a technique designed to make it easier
    to work with databases.
  • Django, with ORM, makes it easier to communicate
    with the database, without having to write
    complex SQL statements.

9
View
  • A view is a function or method that takes
  • http requests as arguments
  • imports the relevant model(s)
  • and finds out what data to send to the template
  • and returns the final result.
  • The views are usually located in a file called
    views.py.

10
Templates
  • A template is a file where you describe how the
    result should be represented.
  • Templates are often .html files, with HTML code
    describing the layout of a web page.
  • but it can also be in other file formats to
    present other results, but here we will
    concentrate on .html files.
  • URLs
  • When a user requests a URL, Django decides which
    view it will send it to.
  • This is done in a file called urls.py.

11
Installation
  • Django can be easily install using python's
    package manager.
  • before installation of django you must have
    python and pip.
  • first open the terminal and execute the following
    commands for installation.
  • pip install django

12
Project
  • Create a project in django
  • open the terminal and navigate a folder in your
    system where you want to create a project.
  • Django-admin startproject djangoProject

13
  • this command will create a project named
    "djangoProject" in your folder.
  • and here is your first django project.

14
Project
  • creating Home page using django framework.
  • open the terminal and navigate a folder in your
    system where you want to create a project.
  • django-admin startproject HomeProject

15
  • cd HomeProject
  • Create app of our project
  • python manage.py startapp myapp
  • code .
  • it will open the project in coding app in your
    system.

16
Application Register
17
  • create a folder named "Templates" in Application.
  • After creating Templates create a new file named
    "home.html".

18
  • After creating a file make their view in
    views.py.

19
  • create a url for http response.

20
  • Then run your project using this commands
  • Open new terminal
  • python manage.py runserver
  • follow the link.

21
And here is your project
22
Creating a webApp
23
  • Creating navbar of webapp

24
  • Code for navbar

25
  • Adding data in web app using django models
  • Create a model in floder named models.py

26
  • Model Migrations
  • Open new terminal and execute the following
    commands
  • Python manage.py makemigrations

27
  • - python manage.py migrate

28
Model Registration
  • Open a folder named admin.py in application
  • Import the created Model in admin.py.

29
  • Register the model

30
  • Import the model in views.py

31
  • Adding content using cards

32
  • Defined code for image card

33
Cards
34
  • Adding content

35
  • Footer for webapp

36
  • Creating footer for project

37
Admin-panel in Django
  • Creating admin panel of webapp
  • Open new terminal and follow the given commands
  • Python manage.py createsuperuser

38
Admin panel
39
  • Added data in panel

40
  • Adding dynamic data to web using MVT architecture.

41
  • Creating template for Page

42
  • Create html file in folder named Templates in
    application
  • And follow the code

43
  • Creating a view for template
  • Click to python file named views.py
  • And create the view for template

44
  • Getting URL for specific created http
    response(view)
  • Click to python file named Urls.py
  • Add views from application
  • And give a path

45
Static
  • Adding Static files in web app
  • Click to settings.py and follow the defined code

46
  • Then move to urls.py and follow the steps for
    static image

47
Thank you
304 Aditya Arcade, Nr. Choice Restaurant CG
Road Ahmedabad Contact 9537344018 www.codingclo
udinstitute.com
Write a Comment
User Comments (0)
About PowerShow.com