Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Docs for context_processors.settings

  • Loading branch information...
commit dff2fd9a42814cccd2863ffbccf4690f74c1efb2 1 parent f8af2ba
Yuri Prezument authored
Showing with 30 additions and 3 deletions.
  1. +2 −2 docs/conf.py
  2. +28 −1 docs/usage.rst
4 docs/conf.py
View
@@ -49,9 +49,9 @@
# built documents.
#
# The short X.Y version.
-version = '0.1.1'
+version = '0.1.2'
# The full version, including alpha/beta/rc tags.
-release = '0.1.1'
+release = '0.1.2'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
29 docs/usage.rst
View
@@ -108,6 +108,33 @@ ExtraContextTemplateView
name='sample_extra_context_view'),
)
+
+Context Processors
+==================
+
+settings (context processor)
+----------------------------
+
+.. autofunction:: useful.context_processors.settings
+
+**Sample usage**
+
+Enable it in settings.py::
+
+ # settings.py
+ TEMPLATE_CONTEXT_PROCESSORS = (
+ # ...
+ 'useful.context_processors.settings',
+ )
+
+Then access `{{ settings }}` in the template, for example::
+
+ {{ settings.SITE_NAME }}
+
+Or::
+
+ {% if settings.DEBUG %}<h1>Debug!</h1>{% endif %}
+
Tasks
=====
@@ -138,4 +165,4 @@ celerybeat.
.. _`Celery`: http://celeryproject.org/
-.. _`Celery periodic tasks`: http://celery.github.com/celery/userguide/periodic-tasks.html
+.. _`Celery periodic tasks`: http://celery.github.com/celery/userguide/periodic-tasks.html
Please sign in to comment.
Something went wrong with that request. Please try again.