2008-08-24 00:25:40 +02:00
|
|
|
.. _ref-contrib-index:
|
|
|
|
|
2007-03-22 04:52:17 +01:00
|
|
|
============================
|
|
|
|
The "django.contrib" add-ons
|
|
|
|
============================
|
2005-11-22 20:21:51 +01:00
|
|
|
|
2006-08-01 22:48:26 +02:00
|
|
|
Django aims to follow Python's `"batteries included" philosophy`_. It ships
|
|
|
|
with a variety of extra, optional tools that solve common Web-development
|
|
|
|
problems.
|
2005-11-22 20:21:51 +01:00
|
|
|
|
2007-06-07 19:50:53 +02:00
|
|
|
This code lives in ``django/contrib`` in the Django distribution. This document
|
2007-06-07 23:41:41 +02:00
|
|
|
gives a rundown of the packages in ``contrib``, along with any dependencies
|
2007-06-07 19:50:53 +02:00
|
|
|
those packages have.
|
2005-11-22 20:21:51 +01:00
|
|
|
|
2007-03-28 00:18:52 +02:00
|
|
|
.. admonition:: Note
|
|
|
|
|
|
|
|
For most of these add-ons -- specifically, the add-ons that include either
|
|
|
|
models or template tags -- you'll need to add the package name (e.g.,
|
|
|
|
``'django.contrib.admin'``) to your ``INSTALLED_APPS`` setting and re-run
|
|
|
|
``manage.py syncdb``.
|
|
|
|
|
2006-08-01 22:48:26 +02:00
|
|
|
.. _"batteries included" philosophy: http://docs.python.org/tut/node12.html#batteries-included
|
|
|
|
|
2008-08-24 00:25:40 +02:00
|
|
|
.. toctree::
|
|
|
|
:maxdepth: 1
|
|
|
|
|
2009-03-23 21:22:56 +01:00
|
|
|
admin/index
|
2008-08-24 00:25:40 +02:00
|
|
|
auth
|
2008-08-26 00:14:22 +02:00
|
|
|
comments/index
|
2008-08-24 00:25:40 +02:00
|
|
|
contenttypes
|
|
|
|
csrf
|
|
|
|
databrowse
|
|
|
|
flatpages
|
|
|
|
formtools/index
|
|
|
|
humanize
|
|
|
|
localflavor
|
2009-12-09 17:57:23 +01:00
|
|
|
messages
|
2008-08-24 00:25:40 +02:00
|
|
|
redirects
|
|
|
|
sitemaps
|
|
|
|
sites
|
|
|
|
syndication
|
|
|
|
webdesign
|
|
|
|
|
2005-11-22 20:21:51 +01:00
|
|
|
admin
|
|
|
|
=====
|
|
|
|
|
|
|
|
The automatic Django administrative interface. For more information, see
|
2008-08-24 00:25:40 +02:00
|
|
|
:ref:`Tutorial 2 <intro-tutorial02>` and the
|
|
|
|
:ref:`admin documentation <ref-contrib-admin>`.
|
2005-11-22 20:21:51 +01:00
|
|
|
|
2007-06-07 19:50:53 +02:00
|
|
|
Requires the auth_ and contenttypes_ contrib packages to be installed.
|
|
|
|
|
2006-05-22 05:14:33 +02:00
|
|
|
auth
|
|
|
|
====
|
|
|
|
|
|
|
|
Django's authentication framework.
|
|
|
|
|
2008-08-24 00:25:40 +02:00
|
|
|
See :ref:`topics-auth`.
|
2006-05-22 05:14:33 +02:00
|
|
|
|
2005-11-22 20:21:51 +01:00
|
|
|
comments
|
|
|
|
========
|
|
|
|
|
2008-09-02 05:40:42 +02:00
|
|
|
.. versionchanged:: 1.0
|
|
|
|
The comments application has been rewriten. See :ref:`ref-contrib-comments-upgrade`
|
|
|
|
for information on howto upgrade.
|
2008-08-26 00:14:22 +02:00
|
|
|
|
|
|
|
A simple yet flexible comments system. See :ref:`ref-contrib-comments-index`.
|
2005-11-22 20:21:51 +01:00
|
|
|
|
2006-05-22 05:14:33 +02:00
|
|
|
contenttypes
|
|
|
|
============
|
|
|
|
|
|
|
|
A light framework for hooking into "types" of content, where each installed
|
2007-12-17 08:39:24 +01:00
|
|
|
Django model is a separate content type.
|
|
|
|
|
2008-08-24 00:25:40 +02:00
|
|
|
See the :ref:`contenttypes documentation <ref-contrib-contenttypes>`.
|
2006-05-22 05:14:33 +02:00
|
|
|
|
|
|
|
csrf
|
|
|
|
====
|
|
|
|
|
|
|
|
A middleware for preventing Cross Site Request Forgeries
|
|
|
|
|
2008-08-24 00:25:40 +02:00
|
|
|
See the :ref:`csrf documentation <ref-contrib-csrf>`.
|
2006-05-22 05:14:33 +02:00
|
|
|
|
2007-12-01 18:07:32 +01:00
|
|
|
flatpages
|
|
|
|
=========
|
|
|
|
|
|
|
|
A framework for managing simple "flat" HTML content in a database.
|
|
|
|
|
2008-08-24 00:25:40 +02:00
|
|
|
See the :ref:`flatpages documentation <ref-contrib-flatpages>`.
|
2007-12-01 18:07:32 +01:00
|
|
|
|
|
|
|
Requires the sites_ contrib package to be installed as well.
|
|
|
|
|
2006-12-05 21:51:25 +01:00
|
|
|
formtools
|
|
|
|
=========
|
|
|
|
|
2008-07-21 18:38:54 +02:00
|
|
|
A set of high-level abstractions for Django forms (django.forms).
|
2006-12-05 21:51:25 +01:00
|
|
|
|
|
|
|
django.contrib.formtools.preview
|
|
|
|
--------------------------------
|
|
|
|
|
|
|
|
An abstraction of the following workflow:
|
|
|
|
|
|
|
|
"Display an HTML form, force a preview, then do something with the submission."
|
|
|
|
|
2008-08-24 00:25:40 +02:00
|
|
|
See the :ref:`form preview documentation <ref-contrib-formtools-form-preview>`.
|
|
|
|
|
|
|
|
django.contrib.formtools.wizard
|
|
|
|
--------------------------------
|
2007-09-15 01:15:40 +02:00
|
|
|
|
2008-08-24 00:25:40 +02:00
|
|
|
Splits forms across multiple Web pages.
|
|
|
|
|
|
|
|
See the :ref:`form wizard documentation <ref-contrib-formtools-form-wizard>`.
|
2006-12-05 21:51:25 +01:00
|
|
|
|
2006-06-04 02:58:39 +02:00
|
|
|
humanize
|
|
|
|
========
|
|
|
|
|
|
|
|
A set of Django template filters useful for adding a "human touch" to data.
|
|
|
|
|
2008-08-24 00:25:40 +02:00
|
|
|
See the :ref:`humanize documentation <ref-contrib-humanize>`.
|
2007-08-20 10:50:08 +02:00
|
|
|
|
2007-02-15 06:53:44 +01:00
|
|
|
localflavor
|
|
|
|
===========
|
|
|
|
|
|
|
|
A collection of various Django snippets that are useful only for a particular
|
2007-12-17 09:58:29 +01:00
|
|
|
country or culture. For example, ``django.contrib.localflavor.us.forms``
|
2007-02-15 06:53:44 +01:00
|
|
|
contains a ``USZipCodeField`` that you can use to validate U.S. zip codes.
|
|
|
|
|
2008-08-24 00:25:40 +02:00
|
|
|
See the :ref:`localflavor documentation <ref-contrib-localflavor>`.
|
2007-12-17 09:58:29 +01:00
|
|
|
|
2008-08-24 00:25:40 +02:00
|
|
|
.. _ref-contrib-markup:
|
2007-12-17 09:58:29 +01:00
|
|
|
|
2005-11-22 20:21:51 +01:00
|
|
|
markup
|
|
|
|
======
|
|
|
|
|
2007-03-28 00:18:52 +02:00
|
|
|
A collection of template filters that implement common markup languages:
|
|
|
|
|
|
|
|
* ``textile`` -- implements `Textile`_
|
|
|
|
* ``markdown`` -- implements `Markdown`_
|
|
|
|
* ``restructuredtext`` -- implements `ReST (ReStructured Text)`_
|
2005-11-22 20:21:51 +01:00
|
|
|
|
2007-03-28 00:18:52 +02:00
|
|
|
In each case, the filter expects formatted markup as a string and returns a
|
|
|
|
string representing the marked-up text. For example, the ``textile`` filter
|
|
|
|
converts text that is marked-up in Textile format to HTML.
|
2005-11-22 20:21:51 +01:00
|
|
|
|
2007-03-28 00:18:52 +02:00
|
|
|
To activate these filters, add ``'django.contrib.markup'`` to your
|
2008-08-24 00:25:40 +02:00
|
|
|
:setting:`INSTALLED_APPS` setting. Once you've done that, use ``{% load markup %}`` in
|
2007-03-28 00:18:52 +02:00
|
|
|
a template, and you'll have access to these filters. For more documentation,
|
|
|
|
read the source code in django/contrib/markup/templatetags/markup.py.
|
2006-07-01 05:25:48 +02:00
|
|
|
|
2007-03-22 04:52:17 +01:00
|
|
|
.. _Textile: http://en.wikipedia.org/wiki/Textile_%28markup_language%29
|
|
|
|
.. _Markdown: http://en.wikipedia.org/wiki/Markdown
|
|
|
|
.. _ReST (ReStructured Text): http://en.wikipedia.org/wiki/ReStructuredText
|
|
|
|
|
2009-12-09 17:57:23 +01:00
|
|
|
messages
|
|
|
|
========
|
|
|
|
|
|
|
|
.. versionchanged:: 1.2
|
|
|
|
The messages framework was added.
|
|
|
|
|
|
|
|
A framework for storing and retrieving temporary cookie- or session-based
|
|
|
|
messages
|
|
|
|
|
|
|
|
See the :ref:`messages documentation <ref-contrib-messages>`.
|
|
|
|
|
2005-11-22 20:21:51 +01:00
|
|
|
redirects
|
|
|
|
=========
|
|
|
|
|
|
|
|
A framework for managing redirects.
|
|
|
|
|
2008-08-24 00:25:40 +02:00
|
|
|
See the :ref:`redirects documentation <ref-contrib-redirects>`.
|
2005-11-22 20:21:51 +01:00
|
|
|
|
2007-12-01 18:07:32 +01:00
|
|
|
sessions
|
|
|
|
========
|
|
|
|
|
|
|
|
A framework for storing data in anonymous sessions.
|
|
|
|
|
2008-08-24 00:25:40 +02:00
|
|
|
See the :ref:`sessions documentation <topics-http-sessions>`.
|
2007-12-01 18:07:32 +01:00
|
|
|
|
2006-05-22 05:14:33 +02:00
|
|
|
sites
|
|
|
|
=====
|
|
|
|
|
|
|
|
A light framework that lets you operate multiple Web sites off of the same
|
|
|
|
database and Django installation. It gives you hooks for associating objects to
|
2006-05-22 06:48:44 +02:00
|
|
|
one or more sites.
|
|
|
|
|
2008-08-24 00:25:40 +02:00
|
|
|
See the :ref:`sites documentation <ref-contrib-sites>`.
|
2006-05-22 05:14:33 +02:00
|
|
|
|
2006-09-01 01:19:53 +02:00
|
|
|
sitemaps
|
|
|
|
========
|
|
|
|
|
|
|
|
A framework for generating Google sitemap XML files.
|
|
|
|
|
2008-08-24 00:25:40 +02:00
|
|
|
See the :ref:`sitemaps documentation <ref-contrib-sitemaps>`.
|
2006-09-01 01:19:53 +02:00
|
|
|
|
2005-11-22 20:21:51 +01:00
|
|
|
syndication
|
|
|
|
===========
|
|
|
|
|
|
|
|
A framework for generating syndication feeds, in RSS and Atom, quite easily.
|
|
|
|
|
2008-08-24 00:25:40 +02:00
|
|
|
See the :ref:`syndication documentation <ref-contrib-syndication>`.
|
2005-11-22 20:21:51 +01:00
|
|
|
|
2007-12-01 18:07:32 +01:00
|
|
|
webdesign
|
|
|
|
=========
|
|
|
|
|
2008-08-10 20:17:20 +02:00
|
|
|
Helpers and utilities targeted primarily at Web *designers* rather than
|
2007-12-04 07:05:28 +01:00
|
|
|
Web *developers*.
|
2007-12-01 18:07:32 +01:00
|
|
|
|
2008-08-24 00:25:40 +02:00
|
|
|
See the :ref:`Web design helpers documentation <ref-contrib-webdesign>`.
|
2007-12-01 18:07:32 +01:00
|
|
|
|
2005-11-22 20:21:51 +01:00
|
|
|
Other add-ons
|
|
|
|
=============
|
|
|
|
|
|
|
|
If you have an idea for functionality to include in ``contrib``, let us know!
|
|
|
|
Code it up, and post it to the `django-users mailing list`_.
|
|
|
|
|
|
|
|
.. _django-users mailing list: http://groups.google.com/group/django-users
|