From 5b45e526c74faf55110ff0afdcba19797d7e0f4d Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Fri, 10 Jul 2009 19:14:09 -0400 Subject: deleted all --- context.py | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 context.py (limited to 'context.py') diff --git a/context.py b/context.py deleted file mode 100644 index f420b154..00000000 --- a/context.py +++ /dev/null @@ -1,9 +0,0 @@ -from django.conf import settings -def application_settings(context): - return { - 'APP_TITLE' : settings.APP_TITLE, - 'APP_URL' : settings.APP_URL, - 'APP_KEYWORDS' : settings.APP_KEYWORDS, - 'APP_DESCRIPTION' : settings.APP_DESCRIPTION, - 'APP_INTRO' : settings.APP_INTRO - } -- cgit v1.2.3-1-g7c22 From faf167aed99ac4e28927f729b7c7bc94a47ef139 Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Sun, 26 Jul 2009 22:33:56 -0400 Subject: merged in latest Mikes changes --- context.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 context.py (limited to 'context.py') diff --git a/context.py b/context.py new file mode 100644 index 00000000..f420b154 --- /dev/null +++ b/context.py @@ -0,0 +1,9 @@ +from django.conf import settings +def application_settings(context): + return { + 'APP_TITLE' : settings.APP_TITLE, + 'APP_URL' : settings.APP_URL, + 'APP_KEYWORDS' : settings.APP_KEYWORDS, + 'APP_DESCRIPTION' : settings.APP_DESCRIPTION, + 'APP_INTRO' : settings.APP_INTRO + } -- cgit v1.2.3-1-g7c22 From ef8f66ba6c7a22c277c6315df8040365b5684e6c Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Wed, 5 Aug 2009 22:50:08 -0400 Subject: added anonymous posting, per-question subscription and fixes by Pothers and some more, see development.log --- context.py | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) (limited to 'context.py') diff --git a/context.py b/context.py index f420b154..c068332c 100644 --- a/context.py +++ b/context.py @@ -1,9 +1,40 @@ from django.conf import settings def application_settings(context): - return { + my_settings = { 'APP_TITLE' : settings.APP_TITLE, 'APP_URL' : settings.APP_URL, 'APP_KEYWORDS' : settings.APP_KEYWORDS, 'APP_DESCRIPTION' : settings.APP_DESCRIPTION, - 'APP_INTRO' : settings.APP_INTRO + 'APP_INTRO' : settings.APP_INTRO, + 'EMAIL_VALIDATION': settings.EMAIL_VALIDATION, + 'LANGUAGE_CODE': settings.LANGUAGE_CODE, + 'GOOGLE_SITEMAP_CODE':settings.GOOGLE_SITEMAP_CODE, + 'GOOGLE_ANALYTICS_KEY':settings.GOOGLE_ANALYTICS_KEY, } + return {'settings':my_settings} + +def auth_processor(request): + """ + Returns context variables required by apps that use Django's authentication + system. + + If there is no 'user' attribute in the request, uses AnonymousUser (from + django.contrib.auth). + """ + if hasattr(request, 'user'): + user = request.user + if user.is_authenticated(): + messages = user.message_set.all() + else: + messages = None + else: + from django.contrib.auth.models import AnonymousUser + user = AnonymousUser() + messages = None + + from django.core.context_processors import PermWrapper + return { + 'user': user, + 'messages': messages, + 'perms': PermWrapper(user), + } -- cgit v1.2.3-1-g7c22