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 'APP_LOGO' : settings.APP_LOGO,
11 'EMAIL_VALIDATION': settings.EMAIL_VALIDATION,
12 'FEEDBACK_SITE_URL': settings.FEEDBACK_SITE_URL,
13 'FORUM_SCRIPT_ALIAS': settings.FORUM_SCRIPT_ALIAS,
14 'LANGUAGE_CODE': settings.LANGUAGE_CODE,
15 'GOOGLE_SITEMAP_CODE':settings.GOOGLE_SITEMAP_CODE,
16 'GOOGLE_ANALYTICS_KEY':settings.GOOGLE_ANALYTICS_KEY,
17 'WIKI_ON':settings.WIKI_ON,
18 'RESOURCE_REVISION':settings.RESOURCE_REVISION,
19 'OSQA_SKIN':settings.OSQA_DEFAULT_SKIN,
20 'APP_FAVICON':settings.APP_FAVICON,
22 return {'settings':my_settings}
24 def auth_processor(request):
26 Returns context variables required by apps that use Django's authentication
29 If there is no 'user' attribute in the request, uses AnonymousUser (from
32 if hasattr(request, 'user'):
34 if user.is_authenticated():
35 messages = user.message_set.all()
39 from django.contrib.auth.models import AnonymousUser
40 user = AnonymousUser()
43 from django.core.context_processors import PermWrapper
47 'perms': PermWrapper(user),