SlideShare a Scribd company logo
4
Most read
8
Most read
9
Most read
Presented By: Sanjay Rathore
(Software Consultant)
Introduction to Django
Framework
Lack of etiquette and manners is a huge turn off.
KnolX Etiquettes
Punctuality
Respect Knolx session timings, you
are requested not to join sessions
after a 5 minutes threshold post
the session start time.
Feedback
Make sure to submit a constructive
feedback for all sessions as it is
very helpful for the presenter.
Silent Mode
Keep your mobile devices in silent
mode, feel free to move out of
session in case you need to attend
an urgent call.
Avoid Disturbance
Avoid unwanted chit chat during
the session.
02
Our Agenda
01 Introduction
02 Features
03 Project Architecture
04 Installation process
05 MVT Architecture
Introduction
● Django is a high-level Python framework. It is free and open-source, written in Python itself, and
follows the model-view-template architectural pattern.
● We can use it to develop quality web applications faster and easier. Since developing for the web
needs a set of similar components, you can use a framework.
● This way, you don’t have to reinvent the wheel. These tasks include authentication, forms, uploading
files, management panels, and so.
LEARN NOW
c
Features
1. Rapid Development
2. Secure
3. Scalable
4. Fully loaded
5. Versatile
6. Open Source
7. Vast and Supported Community
LEARN NOW
OUR MISSION
● The Model is the part of the web-app which acts as a mediator between
the website interface and the database. In technical terms, it is the object
which implements the logic for the application’s data domain.
● View is actually the User Interface of the web-application and contains
the parts like HTML, CSS and other frontend technologies. Generally, this
UI creates from the Models component, i.e., the content comes from the
Models component.
● The controller as the name suggests is the main control component. It
means,the controller handles the user interaction and selects a view
according to the model.
● The main task of the controller is to select a view component according
to the user interaction and also applying the model component.
Project Architecture
Installation Process
Steps to Install Django and Set Up a Virtual Environment
1. Install Python3
$ sudo apt-get install python3
2. Install pip
$ sudo apt-get install -y python3 pip
3. create virtual environment
$ pip3 install virtualenv
4. Installing Django
$ pip install -e django
c
MVT Architecture
Model
logical
DS
Template
presentation
layer
View
data
formatting
design, update,delete
data
input by
user
data to
display
Models :- Just like the Model in MVC, here as well it
has the same functionality of providing the interface
for the data stored in the database.
Views :-In Django, Views act as a link between the
Model data and the Templates. It sees the user request,
retrieves appropriate data from the database, then
renders back the template along with retrieved data.
Templates:- Just like View in MVC, Django uses
templates in its framework. Templates are responsible for
the entire User Interface completely. It handles all the
static parts of the webpage along with the HTML, which
the users visiting the webpage will perceive.
Control Flow
1. The user sends a URL request for a resource to
Django.
2. Django framework then searches for the URL
resource.
3. If the URL path links up to a View, then that
particular View is called.
4. The View will then interact with the Model and
retrieve the appropriate data from the database.
5. The View then renders back an appropriate
template along with the retrieved data to the user.
App Life Cycle
Create an Application
We assume you are in your project folder. In our main “myproject” folder, the same folder then manage.py −
$ python manage.py startapp myapp
myapp/
__init__.py
admin.py
models.py
tests.py
views.py
$ django-admin startapp projectApp
or
Admin Interface
Django provides a ready-to-use user interface for administrative activities.
● We need some modules are imported in the INSTALLED_APPS and MIDDLEWARE_CLASSES tuples of the
myproject/settings.py file.
Create SuperUser for the Admin access
python manage.py createsuperuser
from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('', url(r'^admin/',
include(admin.site.urls)),)
Now run the server -
$ python manage.py runserver
www.website.com
URL Routing
Since Django is a web application framework, it gets user requests by URL locater and responds back. To handle URL,
django.urls module is used by the framework.
Let's open the file urls.py of the project and see the what it looks like:
//urls.py
Django already has mentioned a URL here for the admin. The path function takes the first argument as a route of string
or regex type.
from django.contrib import admin
from django.urls import path
urlpatterns = [
path('admin/', admin.site.urls), ]
www.website.com
Django Temple Language(DTL)
Django’s template engine offers a mini-language to define the
user-facing layer of the application.
A variable looks like this: - {{variable}}.
hello.html
<html>
<body>
Hello World!!! <p>Today is
{{today}}</p>
</body>
</html>
views.py
<html>
<body>
Hello World!!!<p>Today is
{{today}}</p>
</body>
</html>
def hello(request):
today =
datetime.datetime.now().date()
return render(request,
"hello.html", {"today" : today})
www.website.com
Demo
www.website.com
Pros :
● Python is vastly more writable than other language;
● Excellent for big projects;
● Magical ORM;
● Easy database management;
● Security.
cons:
● Not the best for small projects;
● Heavy and you probably won’t utilize the whole framework;
● Monolithic one;
● All components get deployed together.
c
References
LEARN NOW
https://docs.djangoproject.com/en/3.2/
https://developer.mozilla.org/en-US/docs/Learn/Ser
ver-side/Django
Thank You!

More Related Content

PPTX
Introduction to Django
PPTX
Django - Python MVC Framework
KEY
Introduction to Django
PPT
Introduction To Django
PPT
javascript-basics.ppt
PPTX
Web development with django - Basics Presentation
PPTX
Presentation1 project report on apartment management system
PPTX
Python programming | Fundamentals of Python programming
Introduction to Django
Django - Python MVC Framework
Introduction to Django
Introduction To Django
javascript-basics.ppt
Web development with django - Basics Presentation
Presentation1 project report on apartment management system
Python programming | Fundamentals of Python programming

What's hot (20)

PDF
A Basic Django Introduction
PDF
Web Development with Python and Django
PDF
Django Tutorial | Django Web Development With Python | Django Training and Ce...
PDF
Django Introduction & Tutorial
PPT
Angular 8
PDF
Python/Django Training
PPTX
Django Seminar
PPTX
Python/Flask Presentation
PPTX
Reactjs
PPT
Mvc architecture
PDF
Python Django tutorial | Getting Started With Django | Web Development With D...
PDF
PPTX
Spring boot
PPTX
Flask – Python
PPTX
Spring boot Introduction
ODP
Django for Beginners
PPT
Introduction to JavaScript
PPTX
Network programming in java - PPT
PPT
Java Networking
PDF
Java 8 Lambda Expressions
A Basic Django Introduction
Web Development with Python and Django
Django Tutorial | Django Web Development With Python | Django Training and Ce...
Django Introduction & Tutorial
Angular 8
Python/Django Training
Django Seminar
Python/Flask Presentation
Reactjs
Mvc architecture
Python Django tutorial | Getting Started With Django | Web Development With D...
Spring boot
Flask – Python
Spring boot Introduction
Django for Beginners
Introduction to JavaScript
Network programming in java - PPT
Java Networking
Java 8 Lambda Expressions
Ad

Similar to Introduction to django framework (20)

PDF
Django Workflow and Architecture
PPTX
Introduction to Django
PPTX
Basic Python Django
PPTX
Django framework
PPTX
DOCX
What is Full Stack with Django and how to start learning It.docx
PPTX
Django Portfolio Website Workshop (1).pptx
PPTX
Django Framework Interview Question and Answer partOne.pptx
PDF
Step-by-Step Django Web Development with Python
PPTX
Django Framework Overview forNon-Python Developers
PPTX
DOCX
Company Visitor Management System Report.docx
PPTX
React django
PDF
Integrating Machine Learning with Django: A Practical Guide
PDF
Unleashing the Power of Django Building Web Applications with Ease.pdf
PDF
Learn Django Tips, Tricks & Techniques for Developers
PPTX
Django framework
PDF
Rapid web application development using django - Part (1)
PDF
Django Workflow and Architecture
Introduction to Django
Basic Python Django
Django framework
What is Full Stack with Django and how to start learning It.docx
Django Portfolio Website Workshop (1).pptx
Django Framework Interview Question and Answer partOne.pptx
Step-by-Step Django Web Development with Python
Django Framework Overview forNon-Python Developers
Company Visitor Management System Report.docx
React django
Integrating Machine Learning with Django: A Practical Guide
Unleashing the Power of Django Building Web Applications with Ease.pdf
Learn Django Tips, Tricks & Techniques for Developers
Django framework
Rapid web application development using django - Part (1)
Ad

More from Knoldus Inc. (20)

PPTX
Angular Hydration Presentation (FrontEnd)
PPTX
Optimizing Test Execution: Heuristic Algorithm for Self-Healing
PPTX
Self-Healing Test Automation Framework - Healenium
PPTX
Kanban Metrics Presentation (Project Management)
PPTX
Java 17 features and implementation.pptx
PPTX
Chaos Mesh Introducing Chaos in Kubernetes
PPTX
GraalVM - A Step Ahead of JVM Presentation
PPTX
Nomad by HashiCorp Presentation (DevOps)
PPTX
Nomad by HashiCorp Presentation (DevOps)
PPTX
DAPR - Distributed Application Runtime Presentation
PPTX
Introduction to Azure Virtual WAN Presentation
PPTX
Introduction to Argo Rollouts Presentation
PPTX
Intro to Azure Container App Presentation
PPTX
Insights Unveiled Test Reporting and Observability Excellence
PPTX
Introduction to Splunk Presentation (DevOps)
PPTX
Code Camp - Data Profiling and Quality Analysis Framework
PPTX
AWS: Messaging Services in AWS Presentation
PPTX
Amazon Cognito: A Primer on Authentication and Authorization
PPTX
ZIO Http A Functional Approach to Scalable and Type-Safe Web Development
PPTX
Managing State & HTTP Requests In Ionic.
Angular Hydration Presentation (FrontEnd)
Optimizing Test Execution: Heuristic Algorithm for Self-Healing
Self-Healing Test Automation Framework - Healenium
Kanban Metrics Presentation (Project Management)
Java 17 features and implementation.pptx
Chaos Mesh Introducing Chaos in Kubernetes
GraalVM - A Step Ahead of JVM Presentation
Nomad by HashiCorp Presentation (DevOps)
Nomad by HashiCorp Presentation (DevOps)
DAPR - Distributed Application Runtime Presentation
Introduction to Azure Virtual WAN Presentation
Introduction to Argo Rollouts Presentation
Intro to Azure Container App Presentation
Insights Unveiled Test Reporting and Observability Excellence
Introduction to Splunk Presentation (DevOps)
Code Camp - Data Profiling and Quality Analysis Framework
AWS: Messaging Services in AWS Presentation
Amazon Cognito: A Primer on Authentication and Authorization
ZIO Http A Functional Approach to Scalable and Type-Safe Web Development
Managing State & HTTP Requests In Ionic.

Recently uploaded (20)

PPTX
MYSQL Presentation for SQL database connectivity
PPTX
A Presentation on Artificial Intelligence
PPTX
Spectroscopy.pptx food analysis technology
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Electronic commerce courselecture one. Pdf
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
Cloud computing and distributed systems.
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
MYSQL Presentation for SQL database connectivity
A Presentation on Artificial Intelligence
Spectroscopy.pptx food analysis technology
sap open course for s4hana steps from ECC to s4
Unlocking AI with Model Context Protocol (MCP)
20250228 LYD VKU AI Blended-Learning.pptx
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Programs and apps: productivity, graphics, security and other tools
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Assigned Numbers - 2025 - Bluetooth® Document
Electronic commerce courselecture one. Pdf
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Per capita expenditure prediction using model stacking based on satellite ima...
Cloud computing and distributed systems.
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
gpt5_lecture_notes_comprehensive_20250812015547.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Encapsulation_ Review paper, used for researhc scholars
Mobile App Security Testing_ A Comprehensive Guide.pdf
Network Security Unit 5.pdf for BCA BBA.

Introduction to django framework

  • 1. Presented By: Sanjay Rathore (Software Consultant) Introduction to Django Framework
  • 2. Lack of etiquette and manners is a huge turn off. KnolX Etiquettes Punctuality Respect Knolx session timings, you are requested not to join sessions after a 5 minutes threshold post the session start time. Feedback Make sure to submit a constructive feedback for all sessions as it is very helpful for the presenter. Silent Mode Keep your mobile devices in silent mode, feel free to move out of session in case you need to attend an urgent call. Avoid Disturbance Avoid unwanted chit chat during the session.
  • 3. 02 Our Agenda 01 Introduction 02 Features 03 Project Architecture 04 Installation process 05 MVT Architecture
  • 4. Introduction ● Django is a high-level Python framework. It is free and open-source, written in Python itself, and follows the model-view-template architectural pattern. ● We can use it to develop quality web applications faster and easier. Since developing for the web needs a set of similar components, you can use a framework. ● This way, you don’t have to reinvent the wheel. These tasks include authentication, forms, uploading files, management panels, and so. LEARN NOW
  • 5. c Features 1. Rapid Development 2. Secure 3. Scalable 4. Fully loaded 5. Versatile 6. Open Source 7. Vast and Supported Community LEARN NOW
  • 6. OUR MISSION ● The Model is the part of the web-app which acts as a mediator between the website interface and the database. In technical terms, it is the object which implements the logic for the application’s data domain. ● View is actually the User Interface of the web-application and contains the parts like HTML, CSS and other frontend technologies. Generally, this UI creates from the Models component, i.e., the content comes from the Models component. ● The controller as the name suggests is the main control component. It means,the controller handles the user interaction and selects a view according to the model. ● The main task of the controller is to select a view component according to the user interaction and also applying the model component. Project Architecture
  • 7. Installation Process Steps to Install Django and Set Up a Virtual Environment 1. Install Python3 $ sudo apt-get install python3 2. Install pip $ sudo apt-get install -y python3 pip 3. create virtual environment $ pip3 install virtualenv 4. Installing Django $ pip install -e django
  • 8. c MVT Architecture Model logical DS Template presentation layer View data formatting design, update,delete data input by user data to display Models :- Just like the Model in MVC, here as well it has the same functionality of providing the interface for the data stored in the database. Views :-In Django, Views act as a link between the Model data and the Templates. It sees the user request, retrieves appropriate data from the database, then renders back the template along with retrieved data. Templates:- Just like View in MVC, Django uses templates in its framework. Templates are responsible for the entire User Interface completely. It handles all the static parts of the webpage along with the HTML, which the users visiting the webpage will perceive.
  • 9. Control Flow 1. The user sends a URL request for a resource to Django. 2. Django framework then searches for the URL resource. 3. If the URL path links up to a View, then that particular View is called. 4. The View will then interact with the Model and retrieve the appropriate data from the database. 5. The View then renders back an appropriate template along with the retrieved data to the user.
  • 10. App Life Cycle Create an Application We assume you are in your project folder. In our main “myproject” folder, the same folder then manage.py − $ python manage.py startapp myapp myapp/ __init__.py admin.py models.py tests.py views.py $ django-admin startapp projectApp or
  • 11. Admin Interface Django provides a ready-to-use user interface for administrative activities. ● We need some modules are imported in the INSTALLED_APPS and MIDDLEWARE_CLASSES tuples of the myproject/settings.py file. Create SuperUser for the Admin access python manage.py createsuperuser from django.conf.urls import patterns, include, url from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', url(r'^admin/', include(admin.site.urls)),) Now run the server - $ python manage.py runserver
  • 12. www.website.com URL Routing Since Django is a web application framework, it gets user requests by URL locater and responds back. To handle URL, django.urls module is used by the framework. Let's open the file urls.py of the project and see the what it looks like: //urls.py Django already has mentioned a URL here for the admin. The path function takes the first argument as a route of string or regex type. from django.contrib import admin from django.urls import path urlpatterns = [ path('admin/', admin.site.urls), ]
  • 13. www.website.com Django Temple Language(DTL) Django’s template engine offers a mini-language to define the user-facing layer of the application. A variable looks like this: - {{variable}}. hello.html <html> <body> Hello World!!! <p>Today is {{today}}</p> </body> </html> views.py <html> <body> Hello World!!!<p>Today is {{today}}</p> </body> </html> def hello(request): today = datetime.datetime.now().date() return render(request, "hello.html", {"today" : today})
  • 15. www.website.com Pros : ● Python is vastly more writable than other language; ● Excellent for big projects; ● Magical ORM; ● Easy database management; ● Security. cons: ● Not the best for small projects; ● Heavy and you probably won’t utilize the whole framework; ● Monolithic one; ● All components get deployed together.