Created
December 20, 2012 08:20
-
-
Save omaraboumrad/4343762 to your computer and use it in GitHub Desktop.
Django context processor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# in processor.py | |
def site_processor(request): | |
return {'Foo': 'Bar'} | |
# in settings.py | |
from django.conf import global_settings as DEFAULT_SETTINGS | |
TEMPLATE_CONTEXT_PROCESSORS = DEFAULT_SETTINGS.TEMPLATE_CONTEXT_PROCESSORS + ( | |
'myapp.processor.site_processor', | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment