SlideShare a Scribd company logo
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!
Ad

More Related Content

What's hot (20)

Python - An Introduction
Python - An IntroductionPython - An Introduction
Python - An Introduction
Swarit Wadhe
 
Python basic
Python basicPython basic
Python basic
Saifuddin Kaijar
 
JDBC: java DataBase connectivity
JDBC: java DataBase connectivityJDBC: java DataBase connectivity
JDBC: java DataBase connectivity
Tanmoy Barman
 
Python Django tutorial | Getting Started With Django | Web Development With D...
Python Django tutorial | Getting Started With Django | Web Development With D...Python Django tutorial | Getting Started With Django | Web Development With D...
Python Django tutorial | Getting Started With Django | Web Development With D...
Edureka!
 
Applets in java
Applets in javaApplets in java
Applets in java
Wani Zahoor
 
Express js
Express jsExpress js
Express js
Manav Prasad
 
Django
DjangoDjango
Django
Sayeed Far Ooqui
 
Unified process model
Unified process modelUnified process model
Unified process model
RyndaMaala
 
MULTI THREADING IN JAVA
MULTI THREADING IN JAVAMULTI THREADING IN JAVA
MULTI THREADING IN JAVA
VINOTH R
 
Nodejs presentation
Nodejs presentationNodejs presentation
Nodejs presentation
Arvind Devaraj
 
Chapter 03 python libraries
Chapter 03 python librariesChapter 03 python libraries
Chapter 03 python libraries
Praveen M Jigajinni
 
Python File Handling | File Operations in Python | Learn python programming |...
Python File Handling | File Operations in Python | Learn python programming |...Python File Handling | File Operations in Python | Learn python programming |...
Python File Handling | File Operations in Python | Learn python programming |...
Edureka!
 
Basic Concepts in Python
Basic Concepts in PythonBasic Concepts in Python
Basic Concepts in Python
Sumit Satam
 
Datatypes in python
Datatypes in pythonDatatypes in python
Datatypes in python
eShikshak
 
Python Programming ppt
Python Programming pptPython Programming ppt
Python Programming ppt
ismailmrribi
 
Javascript
JavascriptJavascript
Javascript
Manav Prasad
 
Introduction to the basics of Python programming (part 1)
Introduction to the basics of Python programming (part 1)Introduction to the basics of Python programming (part 1)
Introduction to the basics of Python programming (part 1)
Pedro Rodrigues
 
File handling in Python
File handling in PythonFile handling in Python
File handling in Python
Megha V
 
Introduction to Basics of Python
Introduction to Basics of PythonIntroduction to Basics of Python
Introduction to Basics of Python
Elewayte
 
Threads in python
Threads in pythonThreads in python
Threads in python
baabtra.com - No. 1 supplier of quality freshers
 
Python - An Introduction
Python - An IntroductionPython - An Introduction
Python - An Introduction
Swarit Wadhe
 
JDBC: java DataBase connectivity
JDBC: java DataBase connectivityJDBC: java DataBase connectivity
JDBC: java DataBase connectivity
Tanmoy Barman
 
Python Django tutorial | Getting Started With Django | Web Development With D...
Python Django tutorial | Getting Started With Django | Web Development With D...Python Django tutorial | Getting Started With Django | Web Development With D...
Python Django tutorial | Getting Started With Django | Web Development With D...
Edureka!
 
Unified process model
Unified process modelUnified process model
Unified process model
RyndaMaala
 
MULTI THREADING IN JAVA
MULTI THREADING IN JAVAMULTI THREADING IN JAVA
MULTI THREADING IN JAVA
VINOTH R
 
Python File Handling | File Operations in Python | Learn python programming |...
Python File Handling | File Operations in Python | Learn python programming |...Python File Handling | File Operations in Python | Learn python programming |...
Python File Handling | File Operations in Python | Learn python programming |...
Edureka!
 
Basic Concepts in Python
Basic Concepts in PythonBasic Concepts in Python
Basic Concepts in Python
Sumit Satam
 
Datatypes in python
Datatypes in pythonDatatypes in python
Datatypes in python
eShikshak
 
Python Programming ppt
Python Programming pptPython Programming ppt
Python Programming ppt
ismailmrribi
 
Introduction to the basics of Python programming (part 1)
Introduction to the basics of Python programming (part 1)Introduction to the basics of Python programming (part 1)
Introduction to the basics of Python programming (part 1)
Pedro Rodrigues
 
File handling in Python
File handling in PythonFile handling in Python
File handling in Python
Megha V
 
Introduction to Basics of Python
Introduction to Basics of PythonIntroduction to Basics of Python
Introduction to Basics of Python
Elewayte
 

Similar to Introduction to django framework (20)

Django Workflow and Architecture
Django Workflow and ArchitectureDjango Workflow and Architecture
Django Workflow and Architecture
Andolasoft Inc
 
Introduction to Django
Introduction to DjangoIntroduction to Django
Introduction to Django
Ahmed Salama
 
Basic Python Django
Basic Python DjangoBasic Python Django
Basic Python Django
Kaleem Ullah Mangrio
 
Django by rj
Django by rjDjango by rj
Django by rj
Shree M.L.Kakadiya MCA mahila college, Amreli
 
Django framework
Django frameworkDjango framework
Django framework
Arslan Maqsood
 
Django
Django Django
Django
Chaitanaya Sethi
 
What is Full Stack with Django and how to start learning It.docx
What is Full Stack with Django and how to start learning It.docxWhat is Full Stack with Django and how to start learning It.docx
What is Full Stack with Django and how to start learning It.docx
Technogeeks
 
Django Portfolio Website Workshop (1).pptx
Django Portfolio Website Workshop (1).pptxDjango Portfolio Website Workshop (1).pptx
Django Portfolio Website Workshop (1).pptx
AmaraCostachiu
 
Django Framework Interview Question and Answer partOne.pptx
Django Framework Interview Question and Answer partOne.pptxDjango Framework Interview Question and Answer partOne.pptx
Django Framework Interview Question and Answer partOne.pptx
Md. Naimur Rahman
 
Step-by-Step Django Web Development with Python
Step-by-Step Django Web Development with PythonStep-by-Step Django Web Development with Python
Step-by-Step Django Web Development with Python
Shiv Technolabs Pvt. Ltd.
 
Django Framework Overview forNon-Python Developers
Django Framework Overview forNon-Python DevelopersDjango Framework Overview forNon-Python Developers
Django Framework Overview forNon-Python Developers
Rosario Renga
 
Django
DjangoDjango
Django
chaitanayasethi
 
Company Visitor Management System Report.docx
Company Visitor Management System Report.docxCompany Visitor Management System Report.docx
Company Visitor Management System Report.docx
fantabulous2024
 
React django
React djangoReact django
React django
Heber Silva
 
Integrating Machine Learning with Django: A Practical Guide
Integrating Machine Learning with Django: A Practical GuideIntegrating Machine Learning with Django: A Practical Guide
Integrating Machine Learning with Django: A Practical Guide
Shiv Technolabs Pvt. Ltd.
 
Unleashing the Power of Django Building Web Applications with Ease.pdf
Unleashing the Power of Django Building Web Applications with Ease.pdfUnleashing the Power of Django Building Web Applications with Ease.pdf
Unleashing the Power of Django Building Web Applications with Ease.pdf
Prakash775024
 
Learn Django Tips, Tricks & Techniques for Developers
Learn Django Tips, Tricks & Techniques for DevelopersLearn Django Tips, Tricks & Techniques for Developers
Learn Django Tips, Tricks & Techniques for Developers
Mars Devs
 
Django framework
Django framework Django framework
Django framework
TIB Academy
 
Rapid web application development using django - Part (1)
Rapid web application development using django - Part (1)Rapid web application development using django - Part (1)
Rapid web application development using django - Part (1)
Nishant Soni
 
django
djangodjango
django
Prakash775024
 
Django Workflow and Architecture
Django Workflow and ArchitectureDjango Workflow and Architecture
Django Workflow and Architecture
Andolasoft Inc
 
Introduction to Django
Introduction to DjangoIntroduction to Django
Introduction to Django
Ahmed Salama
 
What is Full Stack with Django and how to start learning It.docx
What is Full Stack with Django and how to start learning It.docxWhat is Full Stack with Django and how to start learning It.docx
What is Full Stack with Django and how to start learning It.docx
Technogeeks
 
Django Portfolio Website Workshop (1).pptx
Django Portfolio Website Workshop (1).pptxDjango Portfolio Website Workshop (1).pptx
Django Portfolio Website Workshop (1).pptx
AmaraCostachiu
 
Django Framework Interview Question and Answer partOne.pptx
Django Framework Interview Question and Answer partOne.pptxDjango Framework Interview Question and Answer partOne.pptx
Django Framework Interview Question and Answer partOne.pptx
Md. Naimur Rahman
 
Step-by-Step Django Web Development with Python
Step-by-Step Django Web Development with PythonStep-by-Step Django Web Development with Python
Step-by-Step Django Web Development with Python
Shiv Technolabs Pvt. Ltd.
 
Django Framework Overview forNon-Python Developers
Django Framework Overview forNon-Python DevelopersDjango Framework Overview forNon-Python Developers
Django Framework Overview forNon-Python Developers
Rosario Renga
 
Company Visitor Management System Report.docx
Company Visitor Management System Report.docxCompany Visitor Management System Report.docx
Company Visitor Management System Report.docx
fantabulous2024
 
Integrating Machine Learning with Django: A Practical Guide
Integrating Machine Learning with Django: A Practical GuideIntegrating Machine Learning with Django: A Practical Guide
Integrating Machine Learning with Django: A Practical Guide
Shiv Technolabs Pvt. Ltd.
 
Unleashing the Power of Django Building Web Applications with Ease.pdf
Unleashing the Power of Django Building Web Applications with Ease.pdfUnleashing the Power of Django Building Web Applications with Ease.pdf
Unleashing the Power of Django Building Web Applications with Ease.pdf
Prakash775024
 
Learn Django Tips, Tricks & Techniques for Developers
Learn Django Tips, Tricks & Techniques for DevelopersLearn Django Tips, Tricks & Techniques for Developers
Learn Django Tips, Tricks & Techniques for Developers
Mars Devs
 
Django framework
Django framework Django framework
Django framework
TIB Academy
 
Rapid web application development using django - Part (1)
Rapid web application development using django - Part (1)Rapid web application development using django - Part (1)
Rapid web application development using django - Part (1)
Nishant Soni
 
Ad

More from Knoldus Inc. (20)

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

Recently uploaded (20)

TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 

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.