From 47c95a2821d1fb926446d2379d4b2273af5482dc Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 22 Sep 2010 23:16:13 -0500 Subject: Get secure/unsecure checking actually working We need a bit more, like actually having something relevant in the RequestContext object, in order for this to all work. Instead of putting the full request in just populate a 'secure' key with a boolean value indicating whether the request is secure. Signed-off-by: Dan McGee --- settings.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'settings.py') diff --git a/settings.py b/settings.py index 3a7db393..ea87c2cd 100644 --- a/settings.py +++ b/settings.py @@ -52,6 +52,16 @@ TEMPLATE_LOADERS = ( 'django.template.loaders.app_directories.load_template_source', ) +# We add a processor to determine if the request is secure or not +TEMPLATE_CONTEXT_PROCESSORS = ( + 'django.contrib.auth.context_processors.auth', + 'django.core.context_processors.debug', + 'django.core.context_processors.i18n', + 'django.core.context_processors.media', + 'django.contrib.messages.context_processors.messages', + 'main.context_processors.secure', +) + # This bug is a real bummer: # http://code.djangoproject.com/ticket/14105 MIDDLEWARE_CLASSES = ( -- cgit v1.2.3-55-g3dc8