2005-11-22 20:21:51 +01:00
|
|
|
=====================
|
|
|
|
The "contrib" add-ons
|
|
|
|
=====================
|
|
|
|
|
|
|
|
Django aims to follow Python's "batteries included" philosophy. It ships with a
|
|
|
|
variety of extra, optional tools that solve common Web-development problems.
|
|
|
|
|
|
|
|
This code lives in ``django/contrib`` in the Django distribution. Here's a
|
|
|
|
rundown of the packages in ``contrib``:
|
|
|
|
|
|
|
|
admin
|
|
|
|
=====
|
|
|
|
|
|
|
|
The automatic Django administrative interface. For more information, see
|
2006-05-02 03:31:56 +02:00
|
|
|
`Tutorial 2`_.
|
2005-11-22 20:21:51 +01:00
|
|
|
|
2006-05-02 03:31:56 +02:00
|
|
|
.. _Tutorial 2: http://www.djangoproject.com/documentation/tutorial2/
|
2005-11-22 20:21:51 +01:00
|
|
|
|
2006-05-22 05:14:33 +02:00
|
|
|
auth
|
|
|
|
====
|
|
|
|
|
|
|
|
Django's authentication framework.
|
|
|
|
|
|
|
|
See the `authentication documentation`_.
|
|
|
|
|
|
|
|
.. _authentication documentation: http://www.djangoproject.com/documentation/authentication/
|
|
|
|
|
2005-11-22 20:21:51 +01:00
|
|
|
comments
|
|
|
|
========
|
|
|
|
|
|
|
|
A simple yet flexible comments system. This is not yet documented.
|
|
|
|
|
2006-05-22 05:14:33 +02:00
|
|
|
contenttypes
|
|
|
|
============
|
|
|
|
|
|
|
|
A light framework for hooking into "types" of content, where each installed
|
|
|
|
Django model is a separate content type. This is not yet documented.
|
|
|
|
|
|
|
|
csrf
|
|
|
|
====
|
|
|
|
|
|
|
|
A middleware for preventing Cross Site Request Forgeries
|
|
|
|
|
|
|
|
See the `csrf documentation`_.
|
|
|
|
|
|
|
|
.. _csrf documentation: http://www.djangoproject.com/documentation/csrf/
|
|
|
|
|
2006-06-04 02:58:39 +02:00
|
|
|
humanize
|
|
|
|
========
|
|
|
|
|
|
|
|
A set of Django template filters useful for adding a "human touch" to data.
|
2006-06-08 05:03:19 +02:00
|
|
|
To activate these filters, add ``'django.contrib.humanize'`` to your
|
|
|
|
``INSTALLED_APPS`` setting. Once you've done that, use ``{% load humanize %}``
|
2006-06-04 02:58:39 +02:00
|
|
|
in a template, and you'll have access to these filters:
|
|
|
|
|
2006-06-04 03:03:48 +02:00
|
|
|
apnumber
|
|
|
|
--------
|
2006-06-04 02:58:39 +02:00
|
|
|
|
2006-06-04 03:03:48 +02:00
|
|
|
For numbers 1-9, returns the number spelled out. Otherwise, returns the
|
|
|
|
number. This follows Associated Press style.
|
2006-06-04 02:58:39 +02:00
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
2006-06-04 03:03:48 +02:00
|
|
|
* ``1`` becomes ``'one'``.
|
|
|
|
* ``2`` becomes ``'two'``.
|
|
|
|
* ``10`` becomes ``10``.
|
2006-06-04 02:58:39 +02:00
|
|
|
|
|
|
|
You can pass in either an integer or a string representation of an integer.
|
|
|
|
|
|
|
|
intcomma
|
|
|
|
--------
|
|
|
|
|
|
|
|
Converts an integer to a string containing commas every three digits.
|
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
|
|
|
* ``4500`` becomes ``'4,500'``.
|
|
|
|
* ``45000`` becomes ``'45,000'``.
|
|
|
|
* ``450000`` becomes ``'450,000'``.
|
|
|
|
* ``4500000`` becomes ``'4,500,000'``.
|
|
|
|
|
|
|
|
You can pass in either an integer or a string representation of an integer.
|
|
|
|
|
|
|
|
intword
|
|
|
|
-------
|
|
|
|
|
|
|
|
Converts a large integer to a friendly text representation. Works best for
|
|
|
|
numbers over 1 million.
|
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
|
|
|
* ``1000000`` becomes ``'1.0 million'``.
|
|
|
|
* ``1200000`` becomes ``'1.2 million'``.
|
|
|
|
* ``1200000000`` becomes ``'1.2 billion'``.
|
|
|
|
|
|
|
|
Values up to 1000000000000000 (one quadrillion) are supported.
|
|
|
|
|
|
|
|
You can pass in either an integer or a string representation of an integer.
|
|
|
|
|
2006-06-04 03:03:48 +02:00
|
|
|
ordinal
|
|
|
|
-------
|
|
|
|
|
|
|
|
Converts an integer to its ordinal as a string.
|
|
|
|
|
|
|
|
Examples:
|
|
|
|
|
|
|
|
* ``1`` becomes ``'1st'``.
|
|
|
|
* ``2`` becomes ``'2nd'``.
|
|
|
|
* ``3`` becomes ``'3rd'``.
|
|
|
|
|
|
|
|
You can pass in either an integer or a string representation of an integer.
|
|
|
|
|
2005-11-22 20:21:51 +01:00
|
|
|
flatpages
|
|
|
|
=========
|
|
|
|
|
|
|
|
A framework for managing simple "flat" HTML content in a database.
|
|
|
|
|
|
|
|
See the `flatpages documentation`_.
|
|
|
|
|
|
|
|
.. _flatpages documentation: http://www.djangoproject.com/documentation/flatpages/
|
|
|
|
|
|
|
|
markup
|
|
|
|
======
|
|
|
|
|
|
|
|
A collection of template filters that implement these common markup languages:
|
|
|
|
|
|
|
|
* Textile
|
|
|
|
* Markdown
|
|
|
|
* ReST (ReStructured Text)
|
|
|
|
|
|
|
|
redirects
|
|
|
|
=========
|
|
|
|
|
|
|
|
A framework for managing redirects.
|
|
|
|
|
|
|
|
See the `redirects documentation`_.
|
|
|
|
|
|
|
|
.. _redirects documentation: http://www.djangoproject.com/documentation/redirects/
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
See the `sites documentation`_.
|
|
|
|
|
|
|
|
.. _sites documentation: http://www.djangoproject.com/documentation/sites/
|
2006-05-22 05:14:33 +02:00
|
|
|
|
2005-11-22 20:21:51 +01:00
|
|
|
syndication
|
|
|
|
===========
|
|
|
|
|
|
|
|
A framework for generating syndication feeds, in RSS and Atom, quite easily.
|
|
|
|
|
|
|
|
See the `syndication documentation`_.
|
|
|
|
|
|
|
|
.. _syndication documentation: http://www.djangoproject.com/documentation/syndication/
|
|
|
|
|
|
|
|
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
|