~ubuntu-branches/ubuntu/quantal/python-django/quantal-security

« back to all changes in this revision

Viewing changes to docs/ref/templates/api.txt

  • Committer: Bazaar Package Importer
  • Author(s): Jamie Strandboge
  • Date: 2010-10-12 11:34:35 UTC
  • mfrom: (1.2.7 upstream)
  • mto: This revision was merged to the branch mainline in revision 30.
  • Revision ID: james.westby@ubuntu.com-20101012113435-9lnsrh0i3mxozbt0
Tags: upstream-1.2.3
ImportĀ upstreamĀ versionĀ 1.2.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
.. _ref-templates-api:
2
 
 
3
1
====================================================
4
2
The Django template language: For Python programmers
5
3
====================================================
6
4
 
7
5
This document explains the Django template system from a technical
8
6
perspective -- how it works and how to extend it. If you're just looking for
9
 
reference on the language syntax, see :ref:`topics-templates`.
 
7
reference on the language syntax, see :doc:`/topics/templates`.
10
8
 
11
9
If you're looking to use the Django template system as part of another
12
10
application -- i.e., without the rest of the framework -- make sure to read
323
321
 
324
322
.. versionadded:: 1.2
325
323
   The ``'messages'`` context processor was added.  For more information, see
326
 
   the :ref:`messages documentation <ref-contrib-messages>`.
 
324
   the :doc:`messages documentation </ref/contrib/messages>`.
327
325
 
328
326
.. versionchanged:: 1.2
329
327
    The auth context processor was moved in this release from its old location
384
382
      logged in).
385
383
 
386
384
    * ``messages`` -- A list of messages (as strings) that have been set
387
 
      via the :ref:`messages framework <ref-contrib-messages>`.
 
385
      via the :doc:`messages framework </ref/contrib/messages>`.
388
386
 
389
387
    * ``perms`` -- An instance of
390
388
      ``django.core.context_processors.PermWrapper``, representing the
397
395
.. versionchanged:: 1.2
398
396
   Prior to version 1.2, the ``messages`` variable was a lazy accessor for
399
397
   ``user.get_and_delete_messages()``. It has been changed to include any
400
 
   messages added via the :ref:`messages framework <ref-contrib-messages>`.
 
398
   messages added via the :doc:`messages framework </ref/contrib/messages>`.
401
399
 
402
400
django.core.context_processors.debug
403
401
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
423
421
    * ``LANGUAGE_CODE`` -- ``request.LANGUAGE_CODE``, if it exists. Otherwise,
424
422
      the value of the :setting:`LANGUAGE_CODE` setting.
425
423
 
426
 
See :ref:`topics-i18n` for more.
 
424
See :doc:`/topics/i18n/index` for more.
427
425
 
428
426
django.core.context_processors.media
429
427
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
440
438
.. versionadded:: 1.2
441
439
 
442
440
This processor adds a token that is needed by the ``csrf_token`` template tag
443
 
for protection against :ref:`Cross Site Request Forgeries <ref-contrib-csrf>`.
 
441
for protection against :doc:`Cross Site Request Forgeries </ref/contrib/csrf>`.
444
442
 
445
443
django.core.context_processors.request
446
444
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
458
456
 
459
457
    * ``messages`` -- A list of messages (as strings) that have been set
460
458
      via the user model (using ``user.message_set.create``) or through
461
 
      the :ref:`messages framework <ref-contrib-messages>`.
 
459
      the :doc:`messages framework </ref/contrib/messages>`.
462
460
 
463
461
.. versionadded:: 1.2
464
462
   This template context variable was previously supplied by the ``'auth'``
702
700
 
703
701
Normally, Django will load all the configuration information it needs from its
704
702
own default configuration file, combined with the settings in the module given
705
 
in the :setting:`DJANGO_SETTINGS_MODULE` environment variable. But if you're
 
703
in the :envvar:`DJANGO_SETTINGS_MODULE` environment variable. But if you're
706
704
using the template system independently of the rest of Django, the environment
707
705
variable approach isn't very convenient, because you probably want to configure
708
706
the template system in line with the rest of your application rather than
716
714
:setting:`TEMPLATE_DIRS` (if you're going to use template loaders),
717
715
:setting:`DEFAULT_CHARSET` (although the default of ``utf-8`` is probably fine)
718
716
and :setting:`TEMPLATE_DEBUG`. All available settings are described in the
719
 
:ref:`settings documentation <ref-settings>`, and any setting starting with
 
717
:doc:`settings documentation </ref/settings>`, and any setting starting with
720
718
``TEMPLATE_`` is of obvious interest.
721
719
 
722
720
.. _topic-template-alternate-language: