From e75e4e5201b5117c9b10522dcaff2cbafbf9fb95 Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Wed, 10 Nov 2010 04:25:46 +0100 Subject: [PATCH] Added constance.context_processors.config for easy access to the values. --- constance/context_processors.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 constance/context_processors.py diff --git a/constance/context_processors.py b/constance/context_processors.py new file mode 100644 index 0000000..fa7be62 --- /dev/null +++ b/constance/context_processors.py @@ -0,0 +1,14 @@ +import constance + +def config(request): + """ + Simple context processor that puts the config into every + RequestContext. Just make sure you have a setting like this: + + TEMPLATE_CONTEXT_PROCESSORS = ( + # ... + 'constance.context_processors.config', + ) + + """ + return {"config": constance.config}