0% found this document useful (0 votes)
24 views

Django

The document discusses the Django web framework. It provides an overview of Django's components including models, views, templates, forms, and administration interface. It also covers how Django provides a Model-View-Controller architecture, uses Python and templates, and has an active community. Sites using Django include the Washington Post, World Online, and Pownce.

Uploaded by

Kamil Koc
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views

Django

The document discusses the Django web framework. It provides an overview of Django's components including models, views, templates, forms, and administration interface. It also covers how Django provides a Model-View-Controller architecture, uses Python and templates, and has an active community. Sites using Django include the Washington Post, World Online, and Pownce.

Uploaded by

Kamil Koc
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

The Django Web Framework

Your First Website, or Starting from Scratch


Design database tables Separate Header, Footer, Content sections Present content in coherent manner Refactor...

Web Frameworks

Provide a Model View Controller architecture Designing your URLs Template system

Django

Written in Python Stable Scalable Active community and development

1.0 release in September 2008

Django Principals

Loose coupling Less code Quick development Don't Repeat Yourself Explicit is better than implicit Consistency

The Origin of Django

2003: World Online web developers


Adrian Holovaty Simon Willison

2005: Released as open source Django Reinhardt

Sites Using Django

Washington Post

projects.washingtonpost.com/congress/ projects.washingtonpost.com/fallen/

World Online Pownce EveryBlock djangosites.org

Django Components: Scripts

django-admin.py

Functions specific to Django Functions specific to a Django project

manage.py

Django Components: Models

Predefined field types


Database column HTML widget Validation Programmatic access to database Lazy querysets

Database API

Django Components: URLs

Regular expressions define the URL layout and send information to the View

Virtually any URL scheme can be defined

Specific to App or Project

Django Components: Views


Business logic Gather and prepare data, render template, and send view Generic views

List and detail Date based CRUD

Django Components: Templates


Control the presentation of content Variables Filters Tags

Django Components: Forms


Newforms vs. Oldforms Provides a model for HTML forms


Validation Saving

ModelForm

Django Components: Administration


Out of the box CRUD Newforms Admin makes extending more powerful Not suitable for every occasion

Serving Django with Apache


Install Apache 2 and mod_python Add entry to httpd.conf

Include project settings into Python path

Django Resources

djangoproject.com djangobook.com IRC: irc.freenode.net #django This Week in Django podcast

blog.michaeltrier.com/netcasts

djangosnippets.org pinax.hotcluboffrance.com

You might also like