1 from django.conf import settings
2 def application_settings(context):
4 'APP_TITLE' : settings.APP_TITLE,
5 'APP_SHORT_NAME' : settings.APP_SHORT_NAME,
6 'APP_URL' : settings.APP_URL,
7 'APP_KEYWORDS' : settings.APP_KEYWORDS,
8 'APP_DESCRIPTION' : settings.APP_DESCRIPTION,
9 'APP_INTRO' : settings.APP_INTRO,
10 'EMAIL_VALIDATION': settings.EMAIL_VALIDATION,
11 'LANGUAGE_CODE': settings.LANGUAGE_CODE,
12 'GOOGLE_SITEMAP_CODE':settings.GOOGLE_SITEMAP_CODE,
13 'GOOGLE_ANALYTICS_KEY':settings.GOOGLE_ANALYTICS_KEY,
14 'BOOKS_ON':settings.BOOKS_ON,
15 'WIKI_ON':settings.WIKI_ON,
16 'USE_EXTERNAL_LEGACY_LOGIN':settings.USE_EXTERNAL_LEGACY_LOGIN,
17 'RESOURCE_REVISION':settings.RESOURCE_REVISION,
18 'USE_SPHINX_SEARCH':settings.USE_SPHINX_SEARCH,
19 'OSQA_SKIN':settings.OSQA_DEFAULT_SKIN,
21 return {'settings':my_settings}
23 def auth_processor(request):
25 Returns context variables required by apps that use Django's authentication
28 If there is no 'user' attribute in the request, uses AnonymousUser (from
31 if hasattr(request, 'user'):
33 if user.is_authenticated():
34 messages = user.message_set.all()
38 from django.contrib.auth.models import AnonymousUser
39 user = AnonymousUser()
42 from django.core.context_processors import PermWrapper
46 'perms': PermWrapper(user),