SlideShare a Scribd company logo
Web Development With Django




            A Basic Introduction




                                   Ganga L
Python Frameworks

    Django
    CherryPy
    Pylons
    Flask
    Bottle
    Tipfy
    Pyramid
    Cubic Web
    GAE framework
Outline



   What Is Django?
   Project Structure
   Data Handling
   The Admin Interface
   Django Forms
   Views
   Templates
What Is Django?


   High-level framework for rapid web development
   Complete stack of tools
   Data modelled with Python classes
   Production-ready data admin interface, generated dynamically
   Elegant system for mapping URLs to Python code
   Generic views’ to handle common requests
   Clean, powerful template language
   Components for user authentication, form handling, caching . . .
Creating Projects & Apps


   Creating a project:
        django-admin.py startproject mysite
   Creating an app within a project directory:
         cd mysite
         ./manage.py startapp poll
Project Structure


   A Python package on your PYTHONPATH
   Holds project-wide settings in settings.py
   Holds a URL configuration (URLconf) in urls.py
   Contains or references one or more apps
App

   A Python package on your PYTHONPATH
    (typically created as a subpackage of the project itself)
   May contain data models in models.py
   May contain views in views.py
   May have its own URL configuration in urls.py
Up & Running

   Set PYTHONPATH to include parent of your project directory
   Define new environment variable DJANGO_SETTINGS_MODULE,

       setting it to project settings   (mysite.settings)
   3 Try running the development server:
       /manage.py runserver
Creating The Database


   Create database polls in youe database
   Sync installed apps with database:
       ./manage.py syncdb
Create Project

   Create Project mysite
       mysite/
         manage.py
         mysite/
            __init__.py
            settings.py
            urls.py
Create Application

   python manage.py startapp polls
       polls/
         __init__.py
         models.py
         tests.py
         views.py
Create Models

 from django.db import models

 class Poll(models.Model):
    question = models.CharField(max_length=200)
    pub_date = models.DateTimeField('date published')

 class Choice(models.Model):
    poll = models.ForeignKey(Poll)
    choice_text = models.CharField(max_length=200)
    votes = models.IntegerField(default=0)
The Data Model

    A description of database layout, as a Python class
    Normally represents one database table
    Has fields that map onto columns of the table
    Many built-in field types
         CharField, TextField
         IntegerField, FloatField, DecimalField
         DateField, DateTimeField, TimeField
         EmailField, URLField
         ForeignKey . . .
Installed App

  INSTALLED_APPS = (
      'django.contrib.admin',
      'django.contrib.auth',
      'django.contrib.contenttypes',
      'django.contrib.sessions',
      'django.contrib.messages',
      'django.contrib.staticfiles',
      'polls',
  )


  python manage.py syncdb
Registering Models in Admin


     In admin.py in the Poll app:

    from django.contrib import admin
    from mysite.polls.models import Poll

    admin.site.register(Poll)
In urls.py:

  from django.conf.urls import patterns, include, url

  from django.contrib import admin
  admin.autodiscover()

  urlpatterns = patterns('',
     url(r'^admin/', include(admin.site.urls)),
  )
Generic Views


   Provide ready-made logic for many common tasks:
       Issuing a redirect
       Displaying a paginated list of objects
       Displaying a ‘detail’ page for a single object
       Yearly, monthly or daily listing of date-based
        objects
       ‘Latest items’ page for date-based objects
       Object creation, updating, deletion (with/without
        authorisation)
Generic Views Example

   views.py
    def index(request):
      return HttpResponse("Hello, world. You're at the poll index.")
   Url.py
     from django.conf.urls.defaults import *
     from polls import views

     urlpatterns = patterns('',
                              url(r'^$', views.index, name='index')
                             )
   Main URL.py
     from django.conf.urls import patterns, include, url

     from django.contrib import admin
     admin.autodiscover()

     urlpatterns = patterns('',
                             url(r'^polls/', include('polls.urls')),
                             url(r'^admin/', include(admin.site.urls)),
     )
Creating & Saving Objects


    Invoke constructor and call save method:
    call create method of Club model manager:


poll = Poll(question='what is your DOB? ', year='1986)
poll.save()



Poll.objects.create(question='what is your DOB? ', year='1986)
View Function


   Takes an HTTPRequest object as a parameter
   Returns an HTTPResponse object to caller
   Is associated with a particular URL via the URLconf
HTTP Response


from datetime import date
from django.http import HttpResponse

def today(request):
     html = '<html><body><h2>%s</h2></body></html>' % date.today()
     return HttpResponse(html)




from django.shortcuts import render_to_response
From mysite.polls.models import Poll

def poll_details(request):
     today = date.today()
     poll_data = Poll.objects.all()
     return render_to_response('clubs.html', locals(), context_instance =
                                                                      RequestContext(request))
Templates

    Text files containing
         Variables, replaced by values when the template
          is rendered[
                     {{ today }}
         Filters that modify how values are displayed
                     {{ today|date:"D d M Y" }}
          Tags that control the logic of the rendering
          process
                     {% if name == "nick" %}
                     <p>Hello, Nick!</p>
                     {% else %}
                     <p>Who are you?</p>
                     {% endif %}
Template Example

settings.py

TEMPLATE_DIRS = (
                       os.path.join(os.path.dirname(__file__), 'templates'),
                       )


 templates/club/club_list.html

 {% extends "base.html" %}
 {% block title %}Clubs{% endblock %}
 {% block content %}
     <h1>Clubs</h1>
     <ol>
          {% for club in clubs %}
                <li>{{ club }}</li>
          {% endfor %}
     </ol>
 {% endblock %}
Django Forms

    A collection of fields that knows how to validate itself and display
     itself as HTML.
    Display an HTML form with automatically generated form widgets.
    Check submitted data against a set of validation rules.
    Redisplay a form in the case of validation errors.
    Convert submitted form data to the relevant Python data types.
Django Model Forms

  from django.forms import ModelForm
  import mysite.polls.models import Poll


  class PollForm(ModelForm):
     class Meta:
        model = Pole
A Basic Django Forms
Standard Views.py
Standard Views.py
Standard Views.py
Easy Views.py
Easy Views.py
Summary


   We have shown you
       The structure of a Django project
       How models represent data in Django applications
        How data can be stored and queried via model
        instances
        How data can be managed through a dynamic
        admin interface
        How functionality is represent by views, each
        associated
        with URLs that match a given pattern
       How views render a response using a template
Thank You

More Related Content

What's hot (20)

Introduction To Django
Introduction To DjangoIntroduction To Django
Introduction To Django
Jay Graves
 
Web Development with Python and Django
Web Development with Python and DjangoWeb Development with Python and Django
Web Development with Python and Django
Michael Pirnat
 
Django Seminar
Django SeminarDjango Seminar
Django Seminar
Yokesh Rana
 
Flask – Python
Flask – PythonFlask – Python
Flask – Python
Max Claus Nunes
 
Flask
FlaskFlask
Flask
Mamta Kumari
 
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!
 
Java Servlets
Java ServletsJava Servlets
Java Servlets
BG Java EE Course
 
Django Girls Tutorial
Django Girls TutorialDjango Girls Tutorial
Django Girls Tutorial
Kishimi Ibrahim Ishaq
 
Introduction to django
Introduction to djangoIntroduction to django
Introduction to django
Ilian Iliev
 
Event In JavaScript
Event In JavaScriptEvent In JavaScript
Event In JavaScript
ShahDhruv21
 
Python OOPs
Python OOPsPython OOPs
Python OOPs
Binay Kumar Ray
 
Django Tutorial | Django Web Development With Python | Django Training and Ce...
Django Tutorial | Django Web Development With Python | Django Training and Ce...Django Tutorial | Django Web Development With Python | Django Training and Ce...
Django Tutorial | Django Web Development With Python | Django Training and Ce...
Edureka!
 
Python/Flask Presentation
Python/Flask PresentationPython/Flask Presentation
Python/Flask Presentation
Parag Mujumdar
 
Java Server Pages(jsp)
Java Server Pages(jsp)Java Server Pages(jsp)
Java Server Pages(jsp)
Manisha Keim
 
Introduction to MERN Stack
Introduction to MERN StackIntroduction to MERN Stack
Introduction to MERN Stack
Surya937648
 
Intro to beautiful soup
Intro to beautiful soupIntro to beautiful soup
Intro to beautiful soup
Andreas Chandra
 
Spring Boot and REST API
Spring Boot and REST APISpring Boot and REST API
Spring Boot and REST API
07.pallav
 
Functions in Python
Functions in PythonFunctions in Python
Functions in Python
Kamal Acharya
 
Python list
Python listPython list
Python list
Mohammed Sikander
 
Css pseudo-classes
Css pseudo-classesCss pseudo-classes
Css pseudo-classes
Webtech Learning
 
Introduction To Django
Introduction To DjangoIntroduction To Django
Introduction To Django
Jay Graves
 
Web Development with Python and Django
Web Development with Python and DjangoWeb Development with Python and Django
Web Development with Python and Django
Michael Pirnat
 
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!
 
Introduction to django
Introduction to djangoIntroduction to django
Introduction to django
Ilian Iliev
 
Event In JavaScript
Event In JavaScriptEvent In JavaScript
Event In JavaScript
ShahDhruv21
 
Django Tutorial | Django Web Development With Python | Django Training and Ce...
Django Tutorial | Django Web Development With Python | Django Training and Ce...Django Tutorial | Django Web Development With Python | Django Training and Ce...
Django Tutorial | Django Web Development With Python | Django Training and Ce...
Edureka!
 
Python/Flask Presentation
Python/Flask PresentationPython/Flask Presentation
Python/Flask Presentation
Parag Mujumdar
 
Java Server Pages(jsp)
Java Server Pages(jsp)Java Server Pages(jsp)
Java Server Pages(jsp)
Manisha Keim
 
Introduction to MERN Stack
Introduction to MERN StackIntroduction to MERN Stack
Introduction to MERN Stack
Surya937648
 
Spring Boot and REST API
Spring Boot and REST APISpring Boot and REST API
Spring Boot and REST API
07.pallav
 

Viewers also liked (13)

The Django Web Application Framework 2
The Django Web Application Framework 2The Django Web Application Framework 2
The Django Web Application Framework 2
fishwarter
 
Андрей Колешко «Что не так с Rails»
Андрей Колешко «Что не так с Rails»Андрей Колешко «Что не так с Rails»
Андрей Колешко «Что не так с Rails»
Olga Lavrentieva
 
Building a Dynamic Website Using Django
Building a Dynamic Website Using DjangoBuilding a Dynamic Website Using Django
Building a Dynamic Website Using Django
Nathan Eror
 
Introduction to django
Introduction to djangoIntroduction to django
Introduction to django
Sreenath Ramamoorthi
 
Kivy - Python UI Library for Any Platform
Kivy - Python UI Library for Any PlatformKivy - Python UI Library for Any Platform
Kivy - Python UI Library for Any Platform
Saurav Singhi
 
Введение в Django
Введение в DjangoВведение в Django
Введение в Django
Илья Барышев
 
Building Pluggable Web Applications using Django
Building Pluggable Web Applications using DjangoBuilding Pluggable Web Applications using Django
Building Pluggable Web Applications using Django
Lakshman Prasad
 
Введение в Python и Django
Введение в Python и DjangoВведение в Python и Django
Введение в Python и Django
Taras Lyapun
 
Django in the Real World
Django in the Real WorldDjango in the Real World
Django in the Real World
Jacob Kaplan-Moss
 
쉽게 쓰여진 Django
쉽게 쓰여진 Django쉽게 쓰여진 Django
쉽게 쓰여진 Django
Taehoon Kim
 
Scalable Django Architecture
Scalable Django ArchitectureScalable Django Architecture
Scalable Django Architecture
Rami Sayar
 
The Django Web Application Framework
The Django Web Application FrameworkThe Django Web Application Framework
The Django Web Application Framework
Simon Willison
 
The Django Web Application Framework 2
The Django Web Application Framework 2The Django Web Application Framework 2
The Django Web Application Framework 2
fishwarter
 
Андрей Колешко «Что не так с Rails»
Андрей Колешко «Что не так с Rails»Андрей Колешко «Что не так с Rails»
Андрей Колешко «Что не так с Rails»
Olga Lavrentieva
 
Building a Dynamic Website Using Django
Building a Dynamic Website Using DjangoBuilding a Dynamic Website Using Django
Building a Dynamic Website Using Django
Nathan Eror
 
Kivy - Python UI Library for Any Platform
Kivy - Python UI Library for Any PlatformKivy - Python UI Library for Any Platform
Kivy - Python UI Library for Any Platform
Saurav Singhi
 
Building Pluggable Web Applications using Django
Building Pluggable Web Applications using DjangoBuilding Pluggable Web Applications using Django
Building Pluggable Web Applications using Django
Lakshman Prasad
 
Введение в Python и Django
Введение в Python и DjangoВведение в Python и Django
Введение в Python и Django
Taras Lyapun
 
쉽게 쓰여진 Django
쉽게 쓰여진 Django쉽게 쓰여진 Django
쉽게 쓰여진 Django
Taehoon Kim
 
Scalable Django Architecture
Scalable Django ArchitectureScalable Django Architecture
Scalable Django Architecture
Rami Sayar
 
The Django Web Application Framework
The Django Web Application FrameworkThe Django Web Application Framework
The Django Web Application Framework
Simon Willison
 
Ad

Similar to A Basic Django Introduction (20)

Introduction to Django
Introduction to DjangoIntroduction to Django
Introduction to Django
colinkingswood
 
An Introduction to Django Web Framework
An Introduction to Django Web FrameworkAn Introduction to Django Web Framework
An Introduction to Django Web Framework
David Gibbons
 
Introduction to Django
Introduction to DjangoIntroduction to Django
Introduction to Django
Jagdeep Singh Malhi
 
a hands on guide to django
a hands on guide to djangoa hands on guide to django
a hands on guide to django
swee meng ng
 
Django crush course
Django crush course Django crush course
Django crush course
Mohammed El Rafie Tarabay
 
The Django Web Framework (EuroPython 2006)
The Django Web Framework (EuroPython 2006)The Django Web Framework (EuroPython 2006)
The Django Web Framework (EuroPython 2006)
Simon Willison
 
Python & Django TTT
Python & Django TTTPython & Django TTT
Python & Django TTT
kevinvw
 
Tango with django
Tango with djangoTango with django
Tango with django
Rajan Kumar Upadhyay
 
Introduction to Django
Introduction to DjangoIntroduction to Django
Introduction to Django
Joaquim Rocha
 
Django Introduction Osscamp Delhi September 08 09 2007 Mir Nazim
Django Introduction Osscamp Delhi September 08 09 2007 Mir NazimDjango Introduction Osscamp Delhi September 08 09 2007 Mir Nazim
Django Introduction Osscamp Delhi September 08 09 2007 Mir Nazim
Mir Nazim
 
CCCDjango2010.pdf
CCCDjango2010.pdfCCCDjango2010.pdf
CCCDjango2010.pdf
jayarao21
 
Intro to Web Development Using Python and Django
Intro to Web Development Using Python and DjangoIntro to Web Development Using Python and Django
Intro to Web Development Using Python and Django
Chariza Pladin
 
GDG Addis - An Introduction to Django and App Engine
GDG Addis - An Introduction to Django and App EngineGDG Addis - An Introduction to Django and App Engine
GDG Addis - An Introduction to Django and App Engine
Yared Ayalew
 
You've done the Django Tutorial, what next?
You've done the Django Tutorial, what next?You've done the Django Tutorial, what next?
You've done the Django Tutorial, what next?
Andy McKay
 
django_introduction20141030
django_introduction20141030django_introduction20141030
django_introduction20141030
Kevin Wu
 
Python網站框架絕技: Django 完全攻略班
Python網站框架絕技: Django 完全攻略班Python網站框架絕技: Django 完全攻略班
Python網站框架絕技: Django 完全攻略班
Paul Chao
 
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
 
Introduction to Python and Django
Introduction to Python and DjangoIntroduction to Python and Django
Introduction to Python and Django
solutionstreet
 
Django - basics
Django - basicsDjango - basics
Django - basics
University of Technology
 
Django Architecture Introduction
Django Architecture IntroductionDjango Architecture Introduction
Django Architecture Introduction
Haiqi Chen
 
Introduction to Django
Introduction to DjangoIntroduction to Django
Introduction to Django
colinkingswood
 
An Introduction to Django Web Framework
An Introduction to Django Web FrameworkAn Introduction to Django Web Framework
An Introduction to Django Web Framework
David Gibbons
 
a hands on guide to django
a hands on guide to djangoa hands on guide to django
a hands on guide to django
swee meng ng
 
The Django Web Framework (EuroPython 2006)
The Django Web Framework (EuroPython 2006)The Django Web Framework (EuroPython 2006)
The Django Web Framework (EuroPython 2006)
Simon Willison
 
Python & Django TTT
Python & Django TTTPython & Django TTT
Python & Django TTT
kevinvw
 
Introduction to Django
Introduction to DjangoIntroduction to Django
Introduction to Django
Joaquim Rocha
 
Django Introduction Osscamp Delhi September 08 09 2007 Mir Nazim
Django Introduction Osscamp Delhi September 08 09 2007 Mir NazimDjango Introduction Osscamp Delhi September 08 09 2007 Mir Nazim
Django Introduction Osscamp Delhi September 08 09 2007 Mir Nazim
Mir Nazim
 
CCCDjango2010.pdf
CCCDjango2010.pdfCCCDjango2010.pdf
CCCDjango2010.pdf
jayarao21
 
Intro to Web Development Using Python and Django
Intro to Web Development Using Python and DjangoIntro to Web Development Using Python and Django
Intro to Web Development Using Python and Django
Chariza Pladin
 
GDG Addis - An Introduction to Django and App Engine
GDG Addis - An Introduction to Django and App EngineGDG Addis - An Introduction to Django and App Engine
GDG Addis - An Introduction to Django and App Engine
Yared Ayalew
 
You've done the Django Tutorial, what next?
You've done the Django Tutorial, what next?You've done the Django Tutorial, what next?
You've done the Django Tutorial, what next?
Andy McKay
 
django_introduction20141030
django_introduction20141030django_introduction20141030
django_introduction20141030
Kevin Wu
 
Python網站框架絕技: Django 完全攻略班
Python網站框架絕技: Django 完全攻略班Python網站框架絕技: Django 完全攻略班
Python網站框架絕技: Django 完全攻略班
Paul Chao
 
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
 
Introduction to Python and Django
Introduction to Python and DjangoIntroduction to Python and Django
Introduction to Python and Django
solutionstreet
 
Django Architecture Introduction
Django Architecture IntroductionDjango Architecture Introduction
Django Architecture Introduction
Haiqi Chen
 
Ad

A Basic Django Introduction

  • 1. Web Development With Django A Basic Introduction Ganga L
  • 2. Python Frameworks  Django  CherryPy  Pylons  Flask  Bottle  Tipfy  Pyramid  Cubic Web  GAE framework
  • 3. Outline  What Is Django?  Project Structure  Data Handling  The Admin Interface  Django Forms  Views  Templates
  • 4. What Is Django?  High-level framework for rapid web development  Complete stack of tools  Data modelled with Python classes  Production-ready data admin interface, generated dynamically  Elegant system for mapping URLs to Python code  Generic views’ to handle common requests  Clean, powerful template language  Components for user authentication, form handling, caching . . .
  • 5. Creating Projects & Apps  Creating a project: django-admin.py startproject mysite  Creating an app within a project directory: cd mysite ./manage.py startapp poll
  • 6. Project Structure  A Python package on your PYTHONPATH  Holds project-wide settings in settings.py  Holds a URL configuration (URLconf) in urls.py  Contains or references one or more apps
  • 7. App  A Python package on your PYTHONPATH (typically created as a subpackage of the project itself)  May contain data models in models.py  May contain views in views.py  May have its own URL configuration in urls.py
  • 8. Up & Running  Set PYTHONPATH to include parent of your project directory  Define new environment variable DJANGO_SETTINGS_MODULE, setting it to project settings (mysite.settings)  3 Try running the development server: /manage.py runserver
  • 9. Creating The Database  Create database polls in youe database  Sync installed apps with database: ./manage.py syncdb
  • 10. Create Project  Create Project mysite mysite/ manage.py mysite/ __init__.py settings.py urls.py
  • 11. Create Application  python manage.py startapp polls polls/ __init__.py models.py tests.py views.py
  • 12. Create Models from django.db import models class Poll(models.Model): question = models.CharField(max_length=200) pub_date = models.DateTimeField('date published') class Choice(models.Model): poll = models.ForeignKey(Poll) choice_text = models.CharField(max_length=200) votes = models.IntegerField(default=0)
  • 13. The Data Model  A description of database layout, as a Python class  Normally represents one database table  Has fields that map onto columns of the table  Many built-in field types  CharField, TextField  IntegerField, FloatField, DecimalField  DateField, DateTimeField, TimeField  EmailField, URLField  ForeignKey . . .
  • 14. Installed App INSTALLED_APPS = ( 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'polls', ) python manage.py syncdb
  • 15. Registering Models in Admin  In admin.py in the Poll app: from django.contrib import admin from mysite.polls.models import Poll admin.site.register(Poll)
  • 16. In urls.py: from django.conf.urls import patterns, include, url from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', url(r'^admin/', include(admin.site.urls)), )
  • 17. Generic Views  Provide ready-made logic for many common tasks:  Issuing a redirect  Displaying a paginated list of objects  Displaying a ‘detail’ page for a single object  Yearly, monthly or daily listing of date-based objects  ‘Latest items’ page for date-based objects  Object creation, updating, deletion (with/without authorisation)
  • 18. Generic Views Example  views.py def index(request): return HttpResponse("Hello, world. You're at the poll index.")  Url.py from django.conf.urls.defaults import * from polls import views urlpatterns = patterns('', url(r'^$', views.index, name='index') )  Main URL.py from django.conf.urls import patterns, include, url from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', url(r'^polls/', include('polls.urls')), url(r'^admin/', include(admin.site.urls)), )
  • 19. Creating & Saving Objects  Invoke constructor and call save method:  call create method of Club model manager: poll = Poll(question='what is your DOB? ', year='1986) poll.save() Poll.objects.create(question='what is your DOB? ', year='1986)
  • 20. View Function  Takes an HTTPRequest object as a parameter  Returns an HTTPResponse object to caller  Is associated with a particular URL via the URLconf
  • 21. HTTP Response from datetime import date from django.http import HttpResponse def today(request): html = '<html><body><h2>%s</h2></body></html>' % date.today() return HttpResponse(html) from django.shortcuts import render_to_response From mysite.polls.models import Poll def poll_details(request): today = date.today() poll_data = Poll.objects.all() return render_to_response('clubs.html', locals(), context_instance = RequestContext(request))
  • 22. Templates  Text files containing  Variables, replaced by values when the template is rendered[  {{ today }}  Filters that modify how values are displayed  {{ today|date:"D d M Y" }}  Tags that control the logic of the rendering process  {% if name == "nick" %}  <p>Hello, Nick!</p>  {% else %}  <p>Who are you?</p>  {% endif %}
  • 23. Template Example settings.py TEMPLATE_DIRS = ( os.path.join(os.path.dirname(__file__), 'templates'), ) templates/club/club_list.html {% extends "base.html" %} {% block title %}Clubs{% endblock %} {% block content %} <h1>Clubs</h1> <ol> {% for club in clubs %} <li>{{ club }}</li> {% endfor %} </ol> {% endblock %}
  • 24. Django Forms  A collection of fields that knows how to validate itself and display itself as HTML.  Display an HTML form with automatically generated form widgets.  Check submitted data against a set of validation rules.  Redisplay a form in the case of validation errors.  Convert submitted form data to the relevant Python data types.
  • 25. Django Model Forms from django.forms import ModelForm import mysite.polls.models import Poll class PollForm(ModelForm): class Meta: model = Pole
  • 26. A Basic Django Forms
  • 32. Summary  We have shown you  The structure of a Django project  How models represent data in Django applications  How data can be stored and queried via model instances  How data can be managed through a dynamic admin interface  How functionality is represent by views, each associated with URLs that match a given pattern  How views render a response using a template