SlideShare a Scribd company logo
Django Tech Talk
By Amanpreet Singh
amanpreet.singh1@hindustantimes.com
Why Django?
● Fully loaded.
● Reassuringly secure.
● Exceedingly scalable.
● Incredibly versatile.
● Ridiculously fast.
Django at a
glance.
● Design your model
● Enjoy the free API
● A dynamic admin
interface
● Design your URLs
● Write your views
● Design your templates
IS IT MTV OR MVC??
What do you think?
Django
The model layer
❖ Models
❖ QuerySets
❖ Migrations
❖ Managers
Models
❖ Setup
❖ Field Options(primary_key, null, blank)
❖ Relationships
❖ Backward Relationship( How it works?)
❖ Field Name Restrictions
❖ Meta Options
Models Cont.
❖ Model Attributes (Manager)
❖ Model Methods
❖ Model Inheritance
➢ Abstract Base Class
➢ Derived Class
➢ Multi-table Inheritance
➢ Multiple Inheritance
QuerySets
It can be filtered, sliced etc generally without actually hitting
the database.
No DB activity actually occurs until you do something to
evaluate queryset.
Some Methods
that return new
QuerySet
● filter( )
● all( )
● select_related( )
● values( )
● values_list ( )
● exclude( )
● only( )
● order_by( )
Some Methods
that do not
return new
QuerySet
● get ( )
● get_or_create( )
● create( )
● delete( )
● update( )
● count( )
Field Lookups
● exact
● icontains
● contains
● in
● gte
● lte
● gt
Migrations And Managers
Migrations - A way of propagating changes you make to your
models.
Managers - A manager is the interface through which DB
query operations are provided to django model.
The view layer
❖ URL
❖ Error Handling (Built In Views)
❖ Class Based Views
How Django processes a request?
● ROOT_URLCONF
● urlpatterns
● Runs in order and stops when matches.
● Once matches, django imports and calls the given view.
● If no path matches, exception is raised during any point in
the process.
Error Handling
❖ handler400 ( Bad request)
❖ handler 403 ( Forbidden)
❖ handler 404 ( Page not
Found)
❖ handler 500 (Server Error)
Class Based
Views
● Seperate get, post method
instead of conditional branching
● Multiple Inheritance(Using
Mixins)
● Decorating class-based Views
The template layer
❖ Language overview
❖ Built-in tags and filters (block, comment, lower, firstof)
❖ Custom tags and filters
Django Request
Response Cycle and
The Middlewares
WSGI
Connecting
Web Server
and
Web Framework
A gatekeeper between your web
server and Django Application.
Between the server and the application lie the
middlewares. You can think of middlewares as
a series of bidirectional filters.
Middlewares
The Big Picture — Data Flow
Middlewares ❏ process_request
❏ process_view
❏ process_exception
❏ process_response
Middleware Methods
Context Processors
Thank You

More Related Content

What's hot (20)

PDF
A Basic Django Introduction
Ganga Ram
 
PPT
PHP - Introduction to Object Oriented Programming with PHP
Vibrant Technologies & Computers
 
PDF
Python Flask Tutorial For Beginners | Flask Web Development Tutorial | Python...
Edureka!
 
PPTX
Django Girls Tutorial
Kishimi Ibrahim Ishaq
 
PPTX
[Final] ReactJS presentation
洪 鹏发
 
PDF
What is Django | Django Tutorial for Beginners | Python Django Training | Edu...
Edureka!
 
PPTX
Introduction to Django
Knoldus Inc.
 
PDF
Python Functions Tutorial | Working With Functions In Python | Python Trainin...
Edureka!
 
PDF
Django Introduction & Tutorial
之宇 趙
 
PPTX
Introduction to java 8 stream api
Vladislav sidlyarevich
 
PPT
Reflection in java
upen.rockin
 
PPTX
Angular
LearningTech
 
PDF
Quick flask an intro to flask
juzten
 
PPT
DJango
Sunil OS
 
PPTX
django
Mohamed Essam
 
PDF
Javascript
Momentum Design Lab
 
PPT
Generics in java
suraj pandey
 
PPT
JQuery introduction
NexThoughts Technologies
 
PDF
The Django Web Application Framework
Simon Willison
 
PPTX
React js
Oswald Campesato
 
A Basic Django Introduction
Ganga Ram
 
PHP - Introduction to Object Oriented Programming with PHP
Vibrant Technologies & Computers
 
Python Flask Tutorial For Beginners | Flask Web Development Tutorial | Python...
Edureka!
 
Django Girls Tutorial
Kishimi Ibrahim Ishaq
 
[Final] ReactJS presentation
洪 鹏发
 
What is Django | Django Tutorial for Beginners | Python Django Training | Edu...
Edureka!
 
Introduction to Django
Knoldus Inc.
 
Python Functions Tutorial | Working With Functions In Python | Python Trainin...
Edureka!
 
Django Introduction & Tutorial
之宇 趙
 
Introduction to java 8 stream api
Vladislav sidlyarevich
 
Reflection in java
upen.rockin
 
Angular
LearningTech
 
Quick flask an intro to flask
juzten
 
DJango
Sunil OS
 
Generics in java
suraj pandey
 
JQuery introduction
NexThoughts Technologies
 
The Django Web Application Framework
Simon Willison
 

Similar to Django (20)

PDF
Django
Mohamed Ramadan
 
PPTX
Basic Python Django
Kaleem Ullah Mangrio
 
PPTX
Introduction to Django
Ahmed Salama
 
PDF
django
webuploader
 
PPTX
1-_Introduction_To_Django_Model_and_Database (1).pptx
TamilGamers4
 
PPTX
Django apps and ORM Beyond the basics [Meetup hosted by Prodeers.com]
Udit Gangwani
 
PDF
Django Documentation
Ying wei (Joe) Chou
 
PPTX
Web development with django - Basics Presentation
Shrinath Shenoy
 
PDF
Django 1.10.3 Getting started
MoniaJ
 
PDF
Django Workflow and Architecture
Andolasoft Inc
 
PPTX
Tango with django
Rajan Kumar Upadhyay
 
PDF
Introduction to Python and Django
solutionstreet
 
KEY
Jumpstart Django
ryates
 
DOCX
Akash rajguru project report sem v
Akash Rajguru
 
PDF
Django
Narcisse Siewe
 
PPTX
Why Django for Web Development
Morteza Zohoori Shoar
 
PDF
Django workshop : let's make a blog
Pierre Sudron
 
PDF
Django Patterns - Pycon India 2014
arunvr
 
PDF
Download full ebook of Mastering Django Core Nigel George instant download pdf
ajiyalovelu
 
PDF
Django design-patterns
Agiliq Info Solutions India Pvt Ltd
 
Basic Python Django
Kaleem Ullah Mangrio
 
Introduction to Django
Ahmed Salama
 
django
webuploader
 
1-_Introduction_To_Django_Model_and_Database (1).pptx
TamilGamers4
 
Django apps and ORM Beyond the basics [Meetup hosted by Prodeers.com]
Udit Gangwani
 
Django Documentation
Ying wei (Joe) Chou
 
Web development with django - Basics Presentation
Shrinath Shenoy
 
Django 1.10.3 Getting started
MoniaJ
 
Django Workflow and Architecture
Andolasoft Inc
 
Tango with django
Rajan Kumar Upadhyay
 
Introduction to Python and Django
solutionstreet
 
Jumpstart Django
ryates
 
Akash rajguru project report sem v
Akash Rajguru
 
Why Django for Web Development
Morteza Zohoori Shoar
 
Django workshop : let's make a blog
Pierre Sudron
 
Django Patterns - Pycon India 2014
arunvr
 
Download full ebook of Mastering Django Core Nigel George instant download pdf
ajiyalovelu
 
Django design-patterns
Agiliq Info Solutions India Pvt Ltd
 
Ad

Recently uploaded (20)

PDF
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 
PPTX
Module2 Data Base Design- ER and NF.pptx
gomathisankariv2
 
PPTX
business incubation centre aaaaaaaaaaaaaa
hodeeesite4
 
PPT
1. SYSTEMS, ROLES, AND DEVELOPMENT METHODOLOGIES.ppt
zilow058
 
PDF
CAD-CAM U-1 Combined Notes_57761226_2025_04_22_14_40.pdf
shailendrapratap2002
 
PDF
Zero carbon Building Design Guidelines V4
BassemOsman1
 
PDF
20ME702-Mechatronics-UNIT-1,UNIT-2,UNIT-3,UNIT-4,UNIT-5, 2025-2026
Mohanumar S
 
PPTX
sunil mishra pptmmmmmmmmmmmmmmmmmmmmmmmmm
singhamit111
 
PDF
Biodegradable Plastics: Innovations and Market Potential (www.kiu.ac.ug)
publication11
 
PDF
EVS+PRESENTATIONS EVS+PRESENTATIONS like
saiyedaqib429
 
PDF
AI-Driven IoT-Enabled UAV Inspection Framework for Predictive Maintenance and...
ijcncjournal019
 
PDF
The Effect of Artifact Removal from EEG Signals on the Detection of Epileptic...
Partho Prosad
 
PPTX
22PCOAM21 Session 1 Data Management.pptx
Guru Nanak Technical Institutions
 
PDF
FLEX-LNG-Company-Presentation-Nov-2017.pdf
jbloggzs
 
PPTX
Chapter_Seven_Construction_Reliability_Elective_III_Msc CM
SubashKumarBhattarai
 
PPTX
FUNDAMENTALS OF ELECTRIC VEHICLES UNIT-1
MikkiliSuresh
 
PDF
2025 Laurence Sigler - Advancing Decision Support. Content Management Ecommer...
Francisco Javier Mora Serrano
 
PDF
top-5-use-cases-for-splunk-security-analytics.pdf
yaghutialireza
 
PPTX
22PCOAM21 Session 2 Understanding Data Source.pptx
Guru Nanak Technical Institutions
 
PPTX
MSME 4.0 Template idea hackathon pdf to understand
alaudeenaarish
 
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 
Module2 Data Base Design- ER and NF.pptx
gomathisankariv2
 
business incubation centre aaaaaaaaaaaaaa
hodeeesite4
 
1. SYSTEMS, ROLES, AND DEVELOPMENT METHODOLOGIES.ppt
zilow058
 
CAD-CAM U-1 Combined Notes_57761226_2025_04_22_14_40.pdf
shailendrapratap2002
 
Zero carbon Building Design Guidelines V4
BassemOsman1
 
20ME702-Mechatronics-UNIT-1,UNIT-2,UNIT-3,UNIT-4,UNIT-5, 2025-2026
Mohanumar S
 
sunil mishra pptmmmmmmmmmmmmmmmmmmmmmmmmm
singhamit111
 
Biodegradable Plastics: Innovations and Market Potential (www.kiu.ac.ug)
publication11
 
EVS+PRESENTATIONS EVS+PRESENTATIONS like
saiyedaqib429
 
AI-Driven IoT-Enabled UAV Inspection Framework for Predictive Maintenance and...
ijcncjournal019
 
The Effect of Artifact Removal from EEG Signals on the Detection of Epileptic...
Partho Prosad
 
22PCOAM21 Session 1 Data Management.pptx
Guru Nanak Technical Institutions
 
FLEX-LNG-Company-Presentation-Nov-2017.pdf
jbloggzs
 
Chapter_Seven_Construction_Reliability_Elective_III_Msc CM
SubashKumarBhattarai
 
FUNDAMENTALS OF ELECTRIC VEHICLES UNIT-1
MikkiliSuresh
 
2025 Laurence Sigler - Advancing Decision Support. Content Management Ecommer...
Francisco Javier Mora Serrano
 
top-5-use-cases-for-splunk-security-analytics.pdf
yaghutialireza
 
22PCOAM21 Session 2 Understanding Data Source.pptx
Guru Nanak Technical Institutions
 
MSME 4.0 Template idea hackathon pdf to understand
alaudeenaarish
 
Ad

Django