diff options
| author | Jason Pellerin <jpellerin@gmail.com> | 2006-12-04 18:04:55 +0000 |
|---|---|---|
| committer | Jason Pellerin <jpellerin@gmail.com> | 2006-12-04 18:04:55 +0000 |
| commit | 261fb45ba8ce5ad7c9a0a73c286077c779364b8d (patch) | |
| tree | 6d9e7e60978a06d36bfc5e14b6ddb11359e487d9 /docs/templates_python.txt | |
| parent | f8217026f9618adb65ab2d517025e87b98ed2fbe (diff) | |
[multi-db] Merge trunk to [3875]. Some tests still failing.
git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@4151 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/templates_python.txt')
| -rw-r--r-- | docs/templates_python.txt | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/docs/templates_python.txt b/docs/templates_python.txt index bc05d769ad..39e5b9d91a 100644 --- a/docs/templates_python.txt +++ b/docs/templates_python.txt @@ -366,6 +366,18 @@ If ``TEMPLATE_CONTEXT_PROCESSORS`` contains this processor, every `HttpRequest object`_. Note that this processor is not enabled by default; you'll have to activate it. +Writing your own context processors +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +A context processor has a very simple interface: It's just a Python function +that takes one argument, an ``HttpRequest`` object, and returns a dictionary +that gets added to the template context. Each context processor *must* return +a dictionary. + +Custom context processors can live anywhere in your code base. All Django cares +about is that your custom context processors are pointed-to by your +``TEMPLATE_CONTEXT_PROCESSORS`` setting. + Loading templates ----------------- |
