Developing with Django
          Daniel Ryan
       http://dryan.com
Some Background
Some Background


• Lawrence Journal-World
Some Background


• Lawrence Journal-World
• Ellington
Some Background


• Lawrence Journal-World
• Ellington
• Pycon 2005
Sites Powered by Django
Acronyms Abound
Acronyms Abound


• MTV - Model • Template • View
Acronyms Abound


• MTV - Model • Template • View
• DRY - Don’t Repeat Yourself
Acronyms Abound


• MTV - Model • Template • View
• DRY - Don’t Repeat Yourself
• ORM - Object-relational Mapping
MTV vs. MVC
MTV vs. MVC


• Model = Model
MTV vs. MVC


• Model = Model
• Template = View
MTV vs. MVC


• Model = Model
• Template = View
• View = Controller
Installing Django
Installing Django

• Check out http://dryan.com/articles/snow-
  leopard-64bit-mamp/#python
Installing Django

• Check out http://dryan.com/articles/snow-
  leopard-64bit-mamp/#python

• Python
Installing Django

• Check out http://dryan.com/articles/snow-
  leopard-64bit-mamp/#python

• Python
• Trunk versus Stable Release
Installing Django

• Check out http://dryan.com/articles/snow-
  leopard-64bit-mamp/#python

• Python
• Trunk versus Stable Release
• Third Party Libraries
A Django Workflow
A Django Workflow

• Create a project
A Django Workflow

• Create a project
• Configure settings.py
A Django Workflow

• Create a project
• Configure settings.py
• Configure urls.py
A Django Workflow

• Create a project
• Configure settings.py
• Configure urls.py
• Create the database tables
A Django Workflow
A Django Workflow
• Create an app
A Django Workflow
• Create an app
• Define your models
A Django Workflow
• Create an app
• Define your models
• Create the database tables
A Django Workflow
• Create an app
• Define your models
• Create the database tables
• Define your urls
A Django Workflow
• Create an app
• Define your models
• Create the database tables
• Define your urls
• Define your views
A Django Workflow
• Create an app
• Define your models
• Create the database tables
• Define your urls
• Define your views
• Create your templates
Reduce, Reuse, Recycle
      Django Generic Views
Reduce, Reuse, Recycle
                       Django Generic Views

• direct_to_template               • archive_today
• redirect_to                      • object_detail (date based)
• archive_index                    • object_list
• archive_year                     • object_detail (list based)
• archive_month                    • create_object
• archive_week                     • update_object
• archive_day                      • delete_object
Django Templates
Django Templates
• Just like PHP, except the exact opposite
Django Templates
• Just like PHP, except the exact opposite
• True separation of logic and presentation
Django Templates
• Just like PHP, except the exact opposite
• True separation of logic and presentation
• Global templates vs. app templates
Django Templates
• Just like PHP, except the exact opposite
• True separation of logic and presentation
• Global templates vs. app templates
• Blocks
Django Templates
• Just like PHP, except the exact opposite
• True separation of logic and presentation
• Global templates vs. app templates
• Blocks
• Tags
Django Templates
• Just like PHP, except the exact opposite
• True separation of logic and presentation
• Global templates vs. app templates
• Blocks
• Tags
• Filters
Built-in Tags
Built-in Tags
•   autoescape     •   for             •   now

•   block          •   for ... empty   •   regroup

•   comment        •   if              •   spaceless

•   cycle          •   ifchanged       •   ssi

•   debug          •   ifequal         •   templatetag

•   extends        •   ifnotequal      •   url

•   filter          •   include         •   widthratio

•   firstof         •   load            •   with
Built-in Filters
Built-in Filters
•   add               •   escape          •   length         •   random         •   title

•   addslashes        •   escapejs        •   length_is      •   removetags     •   truncatewords

•   capfirst           •   filesizeformat   •   linebreaks     •   rjust          •   truncatewords_
                                                                                    html
•   center            •   first            •   linebreaksbr   •   safe
                                                                                •   unordered_list
•   cut               •   fix_ampersand    •   linenumbers    •   safeseq
                          s                                                     •   upper
•   date                                  •   ljust          •   slice
                      •   floatformat                                            •   urlencode
•   default                               •   lower          •   slugify
                      •   force_escape                                          •   urlize
•   default_if_none                       •   make_list      •   stringformat
                      •   get_digit                                             •   urlizetrunc
•   dictsort                              •   phone2numeri   •   striptags
                      •   iriencode           c                                 •   wordcount
•   dictsortreverse                                          •   time
    d                 •   join            •   pluralize                         •   wordwrap
                                                             •   timesince
•   divisibleby       •   last            •   pprint                            •   yesno
                                                             •   timeuntil
Other Freebies
    django.contrib
Other Freebies
                                 django.contrib
•   Admin site               •   E-mail (sending)       •   Sessions

•   Authentication           •   Flatpages              •   Signals

•   Cache system             •   Humanize               •   Sitemaps

•   Conditional content      •   Internationalization   •   Sites
    processing
                             •   Jython support         •   Syndication feeds (RSS/
•   Comments                                                Atom)
                             •   “Local flavor”
•   Content types                                       •   Unicode in Django
                             •   Pagination
•   Cross Site Request                                  •   Web design helpers
    Forgery protection       •   Redirects

•   Databrowse               •   Serialization
Resources
Resources

• http://docs.djangoproject.com
Resources

• http://docs.djangoproject.com
• irc://irc.freenode.net/django
Resources

• http://docs.djangoproject.com
• irc://irc.freenode.net/django
• http://thisweekindjango.com/
Resources

• http://docs.djangoproject.com
• irc://irc.freenode.net/django
• http://thisweekindjango.com/
• http://www.djangosnippets.org/
Resources

• http://docs.djangoproject.com
• irc://irc.freenode.net/django
• http://thisweekindjango.com/
• http://www.djangosnippets.org/
• http://code.djangoproject.com/wiki/Tutorials

More Related Content

KEY
Mongo NYC PHP Development
PPTX
Css 3
PPTX
Css 3
ZIP
Cocoa text talk.key
PPTX
ECS19 - Chris Kent - List Formatting in Office 365 and SharePoint 2019
PDF
October 2014 - USG Rock Eagle - Sass 101
PDF
10 Advanced CSS Techniques (You Wish You Knew More About)
PDF
js型変換
Mongo NYC PHP Development
Css 3
Css 3
Cocoa text talk.key
ECS19 - Chris Kent - List Formatting in Office 365 and SharePoint 2019
October 2014 - USG Rock Eagle - Sass 101
10 Advanced CSS Techniques (You Wish You Knew More About)
js型変換

Similar to Developing With Django (20)

KEY
Refactoring RIA Unleashed 2011
KEY
An Evening with MongoDB - Orlando: Welcome and Keynote
PDF
初心者向けGAE/Java説明資料
DOC
PHP Classroom Training
PDF
Client-side MVC with Backbone.js
PDF
SDEC2011 NoSQL concepts and models
PDF
Client-side MVC with Backbone.js (reloaded)
KEY
[2010]我有一个梦想
KEY
Becoming a more productive Rails Developer
PDF
DevLOVE Beautiful Development - 第一幕 陽の巻
PDF
Scala.io
PPTX
Nguyen phuong truong anh a story of bug bounty hunter
KEY
WTF TDD?
KEY
NSLogger - Cocoaheads Paris Presentation - English
KEY
Torquebox rubyhoedown-2012
PDF
Drupal 8 Deep Dive: Plugin System
PDF
下吧开发总结
KEY
Polyglot Grails
PPTX
Scaling with swagger
PDF
Getting the most out of Radiant
Refactoring RIA Unleashed 2011
An Evening with MongoDB - Orlando: Welcome and Keynote
初心者向けGAE/Java説明資料
PHP Classroom Training
Client-side MVC with Backbone.js
SDEC2011 NoSQL concepts and models
Client-side MVC with Backbone.js (reloaded)
[2010]我有一个梦想
Becoming a more productive Rails Developer
DevLOVE Beautiful Development - 第一幕 陽の巻
Scala.io
Nguyen phuong truong anh a story of bug bounty hunter
WTF TDD?
NSLogger - Cocoaheads Paris Presentation - English
Torquebox rubyhoedown-2012
Drupal 8 Deep Dive: Plugin System
下吧开发总结
Polyglot Grails
Scaling with swagger
Getting the most out of Radiant
Ad

Recently uploaded (20)

PDF
A hybrid framework for wild animal classification using fine-tuned DenseNet12...
PPTX
Presentation - Principles of Instructional Design.pptx
PDF
Transform-Your-Supply-Chain-with-AI-Driven-Quality-Engineering.pdf
PDF
NewMind AI Weekly Chronicles – August ’25 Week IV
PDF
The-Future-of-Automotive-Quality-is-Here-AI-Driven-Engineering.pdf
PPTX
AI-driven Assurance Across Your End-to-end Network With ThousandEyes
PDF
Examining Bias in AI Generated News Content.pdf
PDF
CEH Module 2 Footprinting CEH V13, concepts
PDF
Auditboard EB SOX Playbook 2023 edition.
PDF
Transform-Quality-Engineering-with-AI-A-60-Day-Blueprint-for-Digital-Success.pdf
PDF
Dell Pro Micro: Speed customer interactions, patient processing, and learning...
PDF
Electrocardiogram sequences data analytics and classification using unsupervi...
PDF
Transform-Your-Streaming-Platform-with-AI-Driven-Quality-Engineering.pdf
PPTX
Build automations faster and more reliably with UiPath ScreenPlay
PDF
Rapid Prototyping: A lecture on prototyping techniques for interface design
PDF
5-Ways-AI-is-Revolutionizing-Telecom-Quality-Engineering.pdf
PDF
The AI Revolution in Customer Service - 2025
PDF
Introduction to MCP and A2A Protocols: Enabling Agent Communication
PDF
A symptom-driven medical diagnosis support model based on machine learning te...
PDF
Co-training pseudo-labeling for text classification with support vector machi...
A hybrid framework for wild animal classification using fine-tuned DenseNet12...
Presentation - Principles of Instructional Design.pptx
Transform-Your-Supply-Chain-with-AI-Driven-Quality-Engineering.pdf
NewMind AI Weekly Chronicles – August ’25 Week IV
The-Future-of-Automotive-Quality-is-Here-AI-Driven-Engineering.pdf
AI-driven Assurance Across Your End-to-end Network With ThousandEyes
Examining Bias in AI Generated News Content.pdf
CEH Module 2 Footprinting CEH V13, concepts
Auditboard EB SOX Playbook 2023 edition.
Transform-Quality-Engineering-with-AI-A-60-Day-Blueprint-for-Digital-Success.pdf
Dell Pro Micro: Speed customer interactions, patient processing, and learning...
Electrocardiogram sequences data analytics and classification using unsupervi...
Transform-Your-Streaming-Platform-with-AI-Driven-Quality-Engineering.pdf
Build automations faster and more reliably with UiPath ScreenPlay
Rapid Prototyping: A lecture on prototyping techniques for interface design
5-Ways-AI-is-Revolutionizing-Telecom-Quality-Engineering.pdf
The AI Revolution in Customer Service - 2025
Introduction to MCP and A2A Protocols: Enabling Agent Communication
A symptom-driven medical diagnosis support model based on machine learning te...
Co-training pseudo-labeling for text classification with support vector machi...
Ad

Developing With Django