Django

Code

root/django/branches/schema-evolution-ng/docs/add_ons.txt

Revision 4164, 4.8 kB (checked in by adrian, 2 years ago)

Added django.contrib.formtools, including the forced-preview application

Line 
1 =====================
2 The "contrib" add-ons
3 =====================
4
5 Django aims to follow Python's `"batteries included" philosophy`_. It ships
6 with a variety of extra, optional tools that solve common Web-development
7 problems.
8
9 This code lives in ``django/contrib`` in the Django distribution. Here's a
10 rundown of the packages in ``contrib``:
11
12 .. _"batteries included" philosophy: http://docs.python.org/tut/node12.html#batteries-included
13
14 admin
15 =====
16
17 The automatic Django administrative interface. For more information, see
18 `Tutorial 2`_.
19
20 .. _Tutorial 2: http://www.djangoproject.com/documentation/tutorial2/
21
22 auth
23 ====
24
25 Django's authentication framework.
26
27 See the `authentication documentation`_.
28
29 .. _authentication documentation: http://www.djangoproject.com/documentation/authentication/
30
31 comments
32 ========
33
34 A simple yet flexible comments system. This is not yet documented.
35
36 contenttypes
37 ============
38
39 A light framework for hooking into "types" of content, where each installed
40 Django model is a separate content type. This is not yet documented.
41
42 csrf
43 ====
44
45 A middleware for preventing Cross Site Request Forgeries
46
47 See the `csrf documentation`_.
48
49 .. _csrf documentation: http://www.djangoproject.com/documentation/csrf/
50
51 formtools
52 =========
53
54 **New in Django development version**
55
56 A set of high-level abstractions for Django forms (django.newforms).
57
58 django.contrib.formtools.preview
59 --------------------------------
60
61 An abstraction of the following workflow:
62
63 "Display an HTML form, force a preview, then do something with the submission."
64
65 Full documentation for this feature does not yet exist, but you can read the
66 code and docstrings in ``django/contrib/formtools/preview.py`` for a start.
67
68 humanize
69 ========
70
71 A set of Django template filters useful for adding a "human touch" to data.
72 To activate these filters, add ``'django.contrib.humanize'`` to your
73 ``INSTALLED_APPS`` setting. Once you've done that, use ``{% load humanize %}``
74 in a template, and you'll have access to these filters:
75
76 apnumber
77 --------
78
79 For numbers 1-9, returns the number spelled out. Otherwise, returns the
80 number. This follows Associated Press style.
81
82 Examples:
83
84     * ``1`` becomes ``'one'``.
85     * ``2`` becomes ``'two'``.
86     * ``10`` becomes ``10``.
87
88 You can pass in either an integer or a string representation of an integer.
89
90 intcomma
91 --------
92
93 Converts an integer to a string containing commas every three digits.
94
95 Examples:
96
97     * ``4500`` becomes ``'4,500'``.
98     * ``45000`` becomes ``'45,000'``.
99     * ``450000`` becomes ``'450,000'``.
100     * ``4500000`` becomes ``'4,500,000'``.
101
102 You can pass in either an integer or a string representation of an integer.
103
104 intword
105 -------
106
107 Converts a large integer to a friendly text representation. Works best for
108 numbers over 1 million.
109
110 Examples:
111
112     * ``1000000`` becomes ``'1.0 million'``.
113     * ``1200000`` becomes ``'1.2 million'``.
114     * ``1200000000`` becomes ``'1.2 billion'``.
115
116 Values up to 1000000000000000 (one quadrillion) are supported.
117
118 You can pass in either an integer or a string representation of an integer.
119
120 ordinal
121 -------
122
123 Converts an integer to its ordinal as a string.
124
125 Examples:
126
127     * ``1`` becomes ``'1st'``.
128     * ``2`` becomes ``'2nd'``.
129     * ``3`` becomes ``'3rd'``.
130
131 You can pass in either an integer or a string representation of an integer.
132
133 flatpages
134 =========
135
136 A framework for managing simple "flat" HTML content in a database.
137
138 See the `flatpages documentation`_.
139
140 .. _flatpages documentation: http://www.djangoproject.com/documentation/flatpages/
141
142 markup
143 ======
144
145 A collection of template filters that implement these common markup languages:
146
147     * Textile
148     * Markdown
149     * ReST (ReStructured Text)
150
151 For documentation, read the source code in django/contrib/markup/templatetags/markup.py.
152
153 redirects
154 =========
155
156 A framework for managing redirects.
157
158 See the `redirects documentation`_.
159
160 .. _redirects documentation: http://www.djangoproject.com/documentation/redirects/
161
162 sites
163 =====
164
165 A light framework that lets you operate multiple Web sites off of the same
166 database and Django installation. It gives you hooks for associating objects to
167 one or more sites.
168
169 See the `sites documentation`_.
170
171 .. _sites documentation: http://www.djangoproject.com/documentation/sites/
172
173 sitemaps
174 ========
175
176 A framework for generating Google sitemap XML files.
177
178 See the `sitemaps documentation`_.
179
180 .. _sitemaps documentation: http://www.djangoproject.com/documentation/sitemaps/
181
182 syndication
183 ===========
184
185 A framework for generating syndication feeds, in RSS and Atom, quite easily.
186
187 See the `syndication documentation`_.
188
189 .. _syndication documentation: http://www.djangoproject.com/documentation/syndication/
190
191 Other add-ons
192 =============
193
194 If you have an idea for functionality to include in ``contrib``, let us know!
195 Code it up, and post it to the `django-users mailing list`_.
196
197 .. _django-users mailing list: http://groups.google.com/group/django-users
Note: See TracBrowser for help on using the browser.