# in context_processor.py import settings def settings_context(request): """Exposes somewhat filtered project settings in a `project_settings` key of the request context, so you can use stuff like this in templates: {% if project_settings.DEBUG and project_settings.GOOGLE_MAP_API_KEY %}

Dude, Google API key is {{ project_settings.GOOGLE_MAP_API_KEY }}.

{% endif %} """ _settings = {} for setting in dir(settings): if setting.startswith('__'): continue try: setting_value = getattr(settings, setting) if type(setting_value) in [bool, str, int, float, tuple, list, dict]: _settings[setting] = setting_value except: pass return {'project_settings': _settings} # in settings.py TEMPLATE_CONTEXT_PROCESSORS = ( # ... 'myapp.context_processors.settings_context', # ... )