index.txt 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. .. _ref-contrib-index:
  2. ====================
  3. ``contrib`` packages
  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. This code lives in ``django/contrib`` in the Django distribution. This document
  9. gives a rundown of the packages in ``contrib``, along with any dependencies
  10. those packages have.
  11. .. admonition:: Note
  12. For most of these add-ons -- specifically, the add-ons that include either
  13. models or template tags -- you'll need to add the package name (e.g.,
  14. ``'django.contrib.admin'``) to your ``INSTALLED_APPS`` setting and re-run
  15. ``manage.py syncdb``.
  16. .. _"batteries included" philosophy: http://docs.python.org/tutorial/stdlib.html#batteries-included
  17. .. toctree::
  18. :maxdepth: 1
  19. admin/index
  20. auth
  21. comments/index
  22. contenttypes
  23. csrf
  24. databrowse
  25. flatpages
  26. formtools/index
  27. gis/index
  28. humanize
  29. localflavor
  30. messages
  31. redirects
  32. sitemaps
  33. sites
  34. syndication
  35. webdesign
  36. admin
  37. =====
  38. The automatic Django administrative interface. For more information, see
  39. :ref:`Tutorial 2 <intro-tutorial02>` and the
  40. :ref:`admin documentation <ref-contrib-admin>`.
  41. Requires the auth_ and contenttypes_ contrib packages to be installed.
  42. auth
  43. ====
  44. Django's authentication framework.
  45. See :ref:`topics-auth`.
  46. comments
  47. ========
  48. .. versionchanged:: 1.0
  49. The comments application has been rewriten. See :ref:`ref-contrib-comments-upgrade`
  50. for information on howto upgrade.
  51. A simple yet flexible comments system. See :ref:`ref-contrib-comments-index`.
  52. contenttypes
  53. ============
  54. A light framework for hooking into "types" of content, where each installed
  55. Django model is a separate content type.
  56. See the :ref:`contenttypes documentation <ref-contrib-contenttypes>`.
  57. csrf
  58. ====
  59. A middleware for preventing Cross Site Request Forgeries
  60. See the :ref:`csrf documentation <ref-contrib-csrf>`.
  61. flatpages
  62. =========
  63. A framework for managing simple "flat" HTML content in a database.
  64. See the :ref:`flatpages documentation <ref-contrib-flatpages>`.
  65. Requires the sites_ contrib package to be installed as well.
  66. formtools
  67. =========
  68. A set of high-level abstractions for Django forms (django.forms).
  69. django.contrib.formtools.preview
  70. --------------------------------
  71. An abstraction of the following workflow:
  72. "Display an HTML form, force a preview, then do something with the submission."
  73. See the :ref:`form preview documentation <ref-contrib-formtools-form-preview>`.
  74. django.contrib.formtools.wizard
  75. --------------------------------
  76. Splits forms across multiple Web pages.
  77. See the :ref:`form wizard documentation <ref-contrib-formtools-form-wizard>`.
  78. gis
  79. ====
  80. A world-class geospatial framework built on top of Django, that enables
  81. storage, manipulation and display of spatial data.
  82. See the :ref:`ref-contrib-gis` documentation for more.
  83. humanize
  84. ========
  85. A set of Django template filters useful for adding a "human touch" to data.
  86. See the :ref:`humanize documentation <ref-contrib-humanize>`.
  87. localflavor
  88. ===========
  89. A collection of various Django snippets that are useful only for a particular
  90. country or culture. For example, ``django.contrib.localflavor.us.forms``
  91. contains a ``USZipCodeField`` that you can use to validate U.S. zip codes.
  92. See the :ref:`localflavor documentation <ref-contrib-localflavor>`.
  93. .. _ref-contrib-markup:
  94. markup
  95. ======
  96. A collection of template filters that implement common markup languages:
  97. * ``textile`` -- implements `Textile`_ -- requires `PyTextile`_
  98. * ``markdown`` -- implements `Markdown`_ -- requires `Python-markdown`_
  99. * ``restructuredtext`` -- implements `ReST (ReStructured Text)`_
  100. -- requires `doc-utils`_
  101. In each case, the filter expects formatted markup as a string and returns a
  102. string representing the marked-up text. For example, the ``textile`` filter
  103. converts text that is marked-up in Textile format to HTML.
  104. To activate these filters, add ``'django.contrib.markup'`` to your
  105. :setting:`INSTALLED_APPS` setting. Once you've done that, use
  106. ``{% load markup %}`` in a template, and you'll have access to these filters.
  107. For more documentation, read the source code in
  108. :file:`django/contrib/markup/templatetags/markup.py`.
  109. .. _Textile: http://en.wikipedia.org/wiki/Textile_%28markup_language%29
  110. .. _Markdown: http://en.wikipedia.org/wiki/Markdown
  111. .. _ReST (ReStructured Text): http://en.wikipedia.org/wiki/ReStructuredText
  112. .. _PyTextile: http://loopcore.com/python-textile/
  113. .. _Python-markdown: http://www.freewisdom.org/projects/python-markdown
  114. .. _doc-utils: http://docutils.sf.net/
  115. messages
  116. ========
  117. .. versionchanged:: 1.2
  118. The messages framework was added.
  119. A framework for storing and retrieving temporary cookie- or session-based
  120. messages
  121. See the :ref:`messages documentation <ref-contrib-messages>`.
  122. redirects
  123. =========
  124. A framework for managing redirects.
  125. See the :ref:`redirects documentation <ref-contrib-redirects>`.
  126. sessions
  127. ========
  128. A framework for storing data in anonymous sessions.
  129. See the :ref:`sessions documentation <topics-http-sessions>`.
  130. sites
  131. =====
  132. A light framework that lets you operate multiple Web sites off of the same
  133. database and Django installation. It gives you hooks for associating objects to
  134. one or more sites.
  135. See the :ref:`sites documentation <ref-contrib-sites>`.
  136. sitemaps
  137. ========
  138. A framework for generating Google sitemap XML files.
  139. See the :ref:`sitemaps documentation <ref-contrib-sitemaps>`.
  140. syndication
  141. ===========
  142. A framework for generating syndication feeds, in RSS and Atom, quite easily.
  143. See the :ref:`syndication documentation <ref-contrib-syndication>`.
  144. webdesign
  145. =========
  146. Helpers and utilities targeted primarily at Web *designers* rather than
  147. Web *developers*.
  148. See the :ref:`Web design helpers documentation <ref-contrib-webdesign>`.
  149. Other add-ons
  150. =============
  151. If you have an idea for functionality to include in ``contrib``, let us know!
  152. Code it up, and post it to the `django-users mailing list`_.
  153. .. _django-users mailing list: http://groups.google.com/group/django-users