SlideShare a Scribd company logo
Introduction to Django
Framework
6/4/2015 1
Agenda
• Life without Framework
• MVC
• About Django
• Is it MVC or MTV??
• Features
• Django Architecture
• Django Philosophies
• Project Structure
• Django Settings
• URL Dispatcher
6/4/2015 2
Life Without Framework
6/4/2015 3
MVC
6/4/2015 4
About Django
• Django is a free and open source web
application framework, written in Python,
which follows the model–view–
controller (MVC) architectural pattern.
• It is maintained by the Django Software
Foundation (DSF).
6/4/2015 5
Is it MVC or MTV??
• In Django it is called MTV rather than MVC.
Model Model
Template View
View Controller
Models Describes your data
Views Controls what users sees
Templates How user sees it
Controller URL dispatcher
6/4/2015 6
Features
Object Relational Mapper - ORM
MVC (MTV) Architecture
Built-in light weight Web Server
Elegant URL design
Database Migration
6/4/2015 7
Django Architecture
Architecture
6/4/2015 8
Design Philosophies
• Loose Coupling
• Less Code
• Quick Development
• DRY
6/4/2015 9
Project Structure
6/4/2015 10
Settings For Django
• DEBUG True or False
• DATABASES ENGINE postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.. etc
• ROOT_URLCONF app.urls
• MEDIA_ROOT directory that will hold user-uploaded files
• MEDIA_URL To serve media files
• STATIC_ROOT To any server static files css, js and admin UI files (can
add more dirs. to STATICFILES_DIRS)
• STATIC_URL To serve static files
• TEMPLATE_DIRS Template directories
6/4/2015 11
URL Dispatcher
 Root URL should be configured in settings.py
o ROOT_URLCONF = 'app.urls'
 Syntax
– patterns(prefix,
(regular expression, Python callback function [, optional dictionary [, optional name]]) )
– Example:
– urlpatterns = patterns(' ', (r'^articles-year/$', 'mysite.news.views.articles_year'))
– Note:
o No need to add a leading slash (/articles-year)
o The 'r' in front of each regular expression string is optional but recommended. It
tells Python that a string is "raw" -- that nothing in the string should be escaped.
6/4/2015 12
Queries?
6/4/2015 13

More Related Content

PPTX
Django Interview Questions and Answers
PPT
Introduction To Django
KEY
Web application development with Django framework
PPTX
Django app deployment in Azure By Saurabh Agarwal
PPT
Django, What is it, Why is it cool?
PDF
Introduction to django
PPT
JBUG 11 - Django-The Web Framework For Perfectionists With Deadlines
Django Interview Questions and Answers
Introduction To Django
Web application development with Django framework
Django app deployment in Azure By Saurabh Agarwal
Django, What is it, Why is it cool?
Introduction to django
JBUG 11 - Django-The Web Framework For Perfectionists With Deadlines

What's hot (20)

PDF
Automation - fabric, django and more
KEY
Introduction to Django
PDF
A Basic Django Introduction
ODP
Django for Beginners
PDF
Introduction to Django REST Framework, an easy way to build REST framework in...
PPTX
ODP
* DJANGO - The Python Framework - Low Kian Seong, Developer
PDF
Django: Beyond Basics
PPTX
Django Framework Overview forNon-Python Developers
PDF
Django Documentation
PPTX
Introduction to Django
PDF
Free django
PPTX
Django Seminar
PDF
A gentle intro to the Django Framework
PDF
PDF
Django Introduction & Tutorial
PPTX
Django Girls Tutorial
PDF
Best Practices for Front-End Django Developers
PDF
Building RESTful APIs
PDF
Web Development with Python and Django
Automation - fabric, django and more
Introduction to Django
A Basic Django Introduction
Django for Beginners
Introduction to Django REST Framework, an easy way to build REST framework in...
* DJANGO - The Python Framework - Low Kian Seong, Developer
Django: Beyond Basics
Django Framework Overview forNon-Python Developers
Django Documentation
Introduction to Django
Free django
Django Seminar
A gentle intro to the Django Framework
Django Introduction & Tutorial
Django Girls Tutorial
Best Practices for Front-End Django Developers
Building RESTful APIs
Web Development with Python and Django
Ad

Similar to Introduction to django (20)

PPTX
Module2
PPTX
What's new in Angular 2?
PPTX
Sitecore MVC: What it is and why it's important
PDF
Angular js
PPTX
Angular js Online Training
PDF
Angular js
PDF
What Is Angular 2 | Angular 2 Tutorial For Beginners | Angular Training | Edu...
PPTX
Introduction to Django
PPTX
MVC architecture by Mohd.Awais on 18th Aug, 2017
PDF
Spring IO 2016 - Spring Cloud Microservices, a journey inside a financial entity
PDF
SpringIO 2016 - Spring Cloud MicroServices, a journey inside a financial entity
PDF
ASP.NET MVC 4 Introduction
PPTX
Laravel vs Codeigniter, Which is Better PHP Framework_.pptx
PPTX
Ratpack - SpringOne2GX 2015
PPTX
ASP.NET MVC - Latest & Greatest So Far
PPTX
Django PPT.pptx
PPTX
Fast Track introduction to ASP.NET MVC
PDF
Overview of the AngularJS framework
PPTX
SUG Bangalore - Kick Off Session
PDF
Mastering asp.net mvc - Dot Net Tricks
Module2
What's new in Angular 2?
Sitecore MVC: What it is and why it's important
Angular js
Angular js Online Training
Angular js
What Is Angular 2 | Angular 2 Tutorial For Beginners | Angular Training | Edu...
Introduction to Django
MVC architecture by Mohd.Awais on 18th Aug, 2017
Spring IO 2016 - Spring Cloud Microservices, a journey inside a financial entity
SpringIO 2016 - Spring Cloud MicroServices, a journey inside a financial entity
ASP.NET MVC 4 Introduction
Laravel vs Codeigniter, Which is Better PHP Framework_.pptx
Ratpack - SpringOne2GX 2015
ASP.NET MVC - Latest & Greatest So Far
Django PPT.pptx
Fast Track introduction to ASP.NET MVC
Overview of the AngularJS framework
SUG Bangalore - Kick Off Session
Mastering asp.net mvc - Dot Net Tricks
Ad

Recently uploaded (20)

PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Encapsulation theory and applications.pdf
PDF
Machine learning based COVID-19 study performance prediction
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
KodekX | Application Modernization Development
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
Big Data Technologies - Introduction.pptx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
Per capita expenditure prediction using model stacking based on satellite ima...
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
The Rise and Fall of 3GPP – Time for a Sabbatical?
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Advanced methodologies resolving dimensionality complications for autism neur...
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
MYSQL Presentation for SQL database connectivity
Network Security Unit 5.pdf for BCA BBA.
Encapsulation theory and applications.pdf
Machine learning based COVID-19 study performance prediction
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Agricultural_Statistics_at_a_Glance_2022_0.pdf
KodekX | Application Modernization Development
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Digital-Transformation-Roadmap-for-Companies.pptx
Big Data Technologies - Introduction.pptx
Reach Out and Touch Someone: Haptics and Empathic Computing

Introduction to django

  • 2. Agenda • Life without Framework • MVC • About Django • Is it MVC or MTV?? • Features • Django Architecture • Django Philosophies • Project Structure • Django Settings • URL Dispatcher 6/4/2015 2
  • 5. About Django • Django is a free and open source web application framework, written in Python, which follows the model–view– controller (MVC) architectural pattern. • It is maintained by the Django Software Foundation (DSF). 6/4/2015 5
  • 6. Is it MVC or MTV?? • In Django it is called MTV rather than MVC. Model Model Template View View Controller Models Describes your data Views Controls what users sees Templates How user sees it Controller URL dispatcher 6/4/2015 6
  • 7. Features Object Relational Mapper - ORM MVC (MTV) Architecture Built-in light weight Web Server Elegant URL design Database Migration 6/4/2015 7
  • 9. Design Philosophies • Loose Coupling • Less Code • Quick Development • DRY 6/4/2015 9
  • 11. Settings For Django • DEBUG True or False • DATABASES ENGINE postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.. etc • ROOT_URLCONF app.urls • MEDIA_ROOT directory that will hold user-uploaded files • MEDIA_URL To serve media files • STATIC_ROOT To any server static files css, js and admin UI files (can add more dirs. to STATICFILES_DIRS) • STATIC_URL To serve static files • TEMPLATE_DIRS Template directories 6/4/2015 11
  • 12. URL Dispatcher  Root URL should be configured in settings.py o ROOT_URLCONF = 'app.urls'  Syntax – patterns(prefix, (regular expression, Python callback function [, optional dictionary [, optional name]]) ) – Example: – urlpatterns = patterns(' ', (r'^articles-year/$', 'mysite.news.views.articles_year')) – Note: o No need to add a leading slash (/articles-year) o The 'r' in front of each regular expression string is optional but recommended. It tells Python that a string is "raw" -- that nothing in the string should be escaped. 6/4/2015 12