Skip to content

Instantly share code, notes, and snippets.

@b1
Created February 27, 2013 11:20
Show Gist options
  • Save b1/5047223 to your computer and use it in GitHub Desktop.
Save b1/5047223 to your computer and use it in GitHub Desktop.
My first context processor
#!/usr/bin/python
# coding: utf-8
""" send dict to templates. Don't forget set """
from django.conf import settings
def sett_to_tpl():
""" send dict to templates """
# todo: is it needhas to be settings.get('SETT_TO_TPL', '')
return {'SETT_TO_TPL': }
#...
TEMPLATE_CONTEXT_PROCESSORS = (
"project_name.context_processors.sett_to_tpl",
)
#...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment