The Django Framework MSCOSCONF2009 #MOSC2010
The Django Framework MSCOSCONF2009 #MOSC2010
● @lowskter
Why Django
● Models
● Views
● urls
● Templates
Django-Components
● models.py
● Definition for database schemas and fields.
Django-Components
● views.py
● Controlling what is being fed to the templates
and others. The C in MVC.
Django-Components
● urls.py
● Controlling what is served up based on the url
that the user is accessing.
● Lots of regex and pattern matching here.
Some Django tools that are used in
a lot of projects
● This slide is also known as Django killer
features
● Some of django's killer features …
– Admin interface
– Generic Views
– Tags and Filters
– Development server
– Loose coupling
Admin interface
● Simple Views
● A simple view:
urlpatterns = patterns('django.views.generic.simple',
(r'^foo/$', 'direct_to_template', {'template':
'foo_index.html'}),
(r'^foo/(?P<id>\d+)/$', 'direct_to_template', {'template':
'foo_detail.html'}),
)
What if you wanted to do more with
templates?
● For those who think the templates are not
powerful enough.
● Some default built in django tags and filters.
● Custom tags and filters.
Django javascript support
● Apache – mod_python/mod_wsgi
● Windows/Linux support
Case Study
● Process script
● Data modelling and manipulations
● Two case studies-processing scripts+django
web front
● Leveraging the dynamic Python programming
language for various system tasks. What? No
bash?!
Some interesting modules that I
want
● Django-evolve
● Django-sqlalchemy
Django resources
● Django modules
● Django snippets examples
● Free Django book!
Q&A
Q&A Session