source: asadb/settings.py @ cd98e17

space-accessstablestage
Last change on this file since cd98e17 was 7a986f2, checked in by MIT Association of Student Activities <asa@…>, 13 years ago

Enable the messages framework

It appears that reversion depends upon it, and who are we to argue with
our library providers...

  • Property mode set to 100644
File size: 4.0 KB
Line 
1# Django settings for asadb project.
2import os
3import sys
4
5SITE_ROOT = os.path.normpath(os.path.dirname(__file__))
6SITE_WEB_PATH = ''
7
8DEBUG = False
9TEMPLATE_DEBUG = DEBUG
10
11# Is this the main, production deployment?
12# If not, we won't try to propagate things to other systems.
13# (For example, no changing asa-official membership.)
14PRODUCTION_DEPLOYMENT = False
15
16ADMINS = (
17    ('ASA Database Team', 'asa-db@mit.edu',),
18)
19SERVER_EMAIL = 'asa-db-auto@mit.edu'
20DEFAULT_FROM_EMAIL = 'asa-db@mit.edu'
21
22MANAGERS = ADMINS
23
24DATABASES = {}
25
26KRB_KEYTAB = None
27KRB_PRINCIPAL = None
28
29ENABLE_SCRIPTS_AUTH = True
30
31COOKIES_PREFIX = "asadb_"
32SESSION_COOKIE_SECURE = True
33SESSION_COOKIE_HTTPONLY = True
34
35LOGFILE = "asa-db.log"
36
37# Local time zone for this installation. Choices can be found here:
38# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
39# although not all choices may be available on all operating systems.
40# If running in a Windows environment this must be set to the same as your
41# system time zone.
42TIME_ZONE = 'America/New_York'
43
44# Language code for this installation. All choices can be found here:
45# http://www.i18nguy.com/unicode/language-identifiers.html
46LANGUAGE_CODE = 'en-us'
47
48SITE_ID = 1
49
50# If you set this to False, Django will make some optimizations so as not
51# to load the internationalization machinery.
52USE_I18N = True
53
54DATETIME_FORMAT_PYTHON = "%c"
55
56from local_settings import *
57
58SESSION_COOKIE_NAME = COOKIES_PREFIX + "sessionid"
59CSRF_COOKIE_NAME = COOKIES_PREFIX + "csrftoken"
60
61# Absolute path to the directory that holds media.
62# Example: "/home/media/media.lawrence.com/"
63MEDIA_ROOT = SITE_ROOT + '/media/'
64
65# URL that handles the media served from MEDIA_ROOT. Make sure to use a
66# trailing slash if there is a path component (optional in other cases).
67# Examples: "http://media.lawrence.com", "http://example.com/media/"
68MEDIA_URL = SITE_WEB_PATH + '/media/'
69
70# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
71# trailing slash.
72# Examples: "http://foo.com/media/", "/media/".
73ADMIN_MEDIA_PREFIX = SITE_WEB_PATH + '/media/admin/'
74
75LOGIN_REDIRECT_URL  = SITE_WEB_PATH + '/'
76LOGIN_URL  = SITE_WEB_PATH + '/accounts/login'
77LOGOUT_URL = SITE_WEB_PATH + '/accounts/logout'
78
79# List of callables that know how to import templates from various sources.
80TEMPLATE_LOADERS = (
81    'django.template.loaders.filesystem.Loader',
82    'django.template.loaders.app_directories.Loader',
83#     'django.template.loaders.eggs.load_template_source',
84)
85
86TEMPLATE_CONTEXT_PROCESSORS = (
87    "django.contrib.messages.context_processors.messages",
88    "django.contrib.auth.context_processors.auth",
89    "django.core.context_processors.debug",
90    "django.core.context_processors.i18n",
91    "django.core.context_processors.media",
92    "django.core.context_processors.request",
93)
94
95MIDDLEWARE_CLASSES = [
96    'django.middleware.common.CommonMiddleware',
97    'django.contrib.sessions.middleware.SessionMiddleware',
98    'django.contrib.auth.middleware.AuthenticationMiddleware',
99    'django.middleware.transaction.TransactionMiddleware',
100    'django.middleware.csrf.CsrfViewMiddleware',
101    'reversion.middleware.RevisionMiddleware',
102    'django.contrib.messages.middleware.MessageMiddleware',
103]
104
105AUTHENTICATION_BACKENDS = [
106    'groups.models.PerGroupAuthz',
107    'django.contrib.auth.backends.ModelBackend',
108]
109
110if ENABLE_SCRIPTS_AUTH:
111    MIDDLEWARE_CLASSES.append('mit.ScriptsRemoteUserMiddleware')
112    AUTHENTICATION_BACKENDS.insert(0, 'mit.ScriptsRemoteUserBackend')
113
114
115ROOT_URLCONF = 'asadb.urls'
116
117TEMPLATE_DIRS = (
118    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
119    # Always use forward slashes, even on Windows.
120    # Don't forget to use absolute paths, not relative paths.
121    'template',
122)
123
124INSTALLED_APPS = (
125    'django.contrib.admin',
126    'django.contrib.admindocs',
127    'django.contrib.auth',
128    'django.contrib.contenttypes',
129    'django.contrib.messages',
130    'django.contrib.sessions',
131    'django.contrib.sites',
132    'form_utils',
133    'django_filters',
134    'reversion',
135    'south',
136    'groups',
137    'forms',
138    'space',
139)
140
141from local_settings_after import *
Note: See TracBrowser for help on using the repository browser.