Ticket #1278: template_context_constants.patch
File template_context_constants.patch, 3.2 KB (added by , 18 years ago) |
---|
-
django/conf/global_settings.py
136 136 # only parameter and returns a dictionary to add to the context. 137 137 TEMPLATE_CONTEXT_PROCESSORS = ( 138 138 'django.core.context_processors.auth', 139 'django.core.context_processors.constants', 139 140 'django.core.context_processors.debug', 140 141 'django.core.context_processors.i18n', 141 # 'django.core.context_process ors.request',142 # 'django.core.context_processrs.request', 142 143 ) 143 144 145 # Constants to add to all template contexts. 146 TEMPLATE_CONTEXT_CONSTANTS = {} 147 144 148 # Output to use in template system for invalid (e.g. misspelled) variables. 145 149 TEMPLATE_STRING_IF_INVALID = '' 146 150 -
django/conf/project_template/settings.py
56 56 # 'django.template.loaders.eggs.load_template_source', 57 57 ) 58 58 59 # Constants to add to all template contexts (dependant on the context 60 # processor 'django.core.context_processors.constants'). 61 TEMPLATE_CONTEXT_CONSTANTS = {'media_url': MEDIA_URL} 62 59 63 MIDDLEWARE_CLASSES = ( 60 64 'django.middleware.common.CommonMiddleware', 61 65 'django.contrib.sessions.middleware.SessionMiddleware', -
django/core/context_processors.py
20 20 'perms': PermWrapper(request.user), 21 21 } 22 22 23 def constants(request): 24 return settings.TEMPLATE_CONTEXT_CONSTANTS 25 23 26 def debug(request): 24 27 "Returns context variables helpful for debugging." 25 28 context_extras = {} -
docs/settings.txt
717 717 Default:: 718 718 719 719 ("django.core.context_processors.auth", 720 "django.core.context_processors.constants", 720 721 "django.core.context_processors.debug", 721 722 "django.core.context_processors.i18n") 722 723 -
docs/templates_python.txt
290 290 ``TEMPLATE_CONTEXT_PROCESSORS`` is set to:: 291 291 292 292 ("django.core.context_processors.auth", 293 "django.core.context_processors.constants", 293 294 "django.core.context_processors.debug", 294 295 "django.core.context_processors.i18n") 295 296 … … 371 372 representing every SQL query that has happened so far during the request 372 373 and how long it took. The list is in order by query. 373 374 375 django.core.context_processors.constants 376 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 377 378 If ``TEMPLATE_CONTEXT_PROCESSORS`` contains this processor, every 379 ``Context`` will contain variables defined in the ``TEMPLATE_CONTEXT_CONSTANTS`` 380 setting. 381 374 382 django.core.context_processors.i18n 375 383 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 376 384