{ "info": { "author": "Mike Fogel", "author_email": "mike@fogel.ca", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Utilities" ], "description": "---------- django-settings-context-processor ----------\n-------------------------------------------------------\n\n\nWhat does it do?\n---------------\nMakes specified django settings visible in the template rendering context.\n\n\nHow does it do it?\n------------------\ndjango-settings-context-processor takes the settings variable\nTEMPLATE_VISIBLE_SETTINGS, which should be an iterable of strings,\nand looks for a settings of the name of each iterable. The name-value\npair of this setting is then added to the template rendering context.\n\n\nCan I see an example?\n---------------------\nYes! Assuming the root django-settings-context-processor is in your\nPYTHON_PATH, this should work:\n\nsettings.py:\n\n INSTALLED_APPS = (\n ......\n 'settings_context_processor',\n )\n\n TEMPLATE_CONTEXT_PROCESSORS = (\n # the first 5 here are the django 1.2.1 default context processors\n 'django.contrib.auth.context_processors.auth',\n 'django.core.context_processors.debug',\n 'django.core.context_processors.i18n',\n 'django.core.context_processors.media',\n 'django.contrib.messages.context_processors.messages',\n ......\n 'settings_context_processor.context_processors.settings',\n )\n\n # define some settings we'd like to export\n CONTACT_PHONE='(555) 555-5555'\n CONTACT_EMAIL='contact@someplace.com\n CONTACT_ADDR_STREET='123 Anywhere Rd.'\n CONTACT_ADDR_CITYSTATE='Anyplace, AS 12345'\n\n # for settings_context_processor\n TEMPLATE_VISIBLE_SETTINGS = (\n 'CONTACT_PHONE',\n 'CONTACT_EMAIL',\n 'CONTACT_ADDR_STREET',\n 'CONTACT_ADDR_CITYSTATE',\n )\n\n\nsome_template.html:\n\n