O'Reilly logo

Next-Generation Web Frameworks in Python by Liza Daly

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Django

Philosophy: A Unified Package to Develop Applications Quickly

Django (http://www.djangoproject.com) got its start as an environment for running newsroom applications. Later it was abstracted and released as an open-source web framework. This heritage is apparent throughout the package—in the documentation, in the built-in administration interface, and in the standard library. Despite its origins, Django includes all the components necessary to develop any basic web application: an object-relational mapper for the database, a templating system for inserting dynamic content into output pages, and a place to hang Python functions that tie it all together.

Django does not use a third-party application server such as CherryPy (see the TurboGears chapter). It does come with a manager script ("manage.py") that can invoke a simple development server, but relies on a web server running mod_python or FastCGI for production deployment.

Only features and syntax available in Django 0.95 are described next. This is the latest stable release as of this writing.

Data Modeling: An ORM of One's Own

Django advocates a "model-centric" approach to development, in which all the essential fields and behaviors of the data (and thus much of the behavior of the application itself) are part of the model. As in the other frameworks discussed here, the model is meant to be designed primarily in Python code. The database schema and data maintenance process are handled by Django based on that model. This is ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required