mirror of
https://github.com/jazzband/django-constance.git
synced 2026-03-16 22:40:24 +00:00
Added constance.context_processors.config for easy access to the values.
This commit is contained in:
parent
1804b3ea6b
commit
e75e4e5201
1 changed files with 14 additions and 0 deletions
14
constance/context_processors.py
Normal file
14
constance/context_processors.py
Normal file
|
|
@ -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}
|
||||
Loading…
Reference in a new issue