1 | # Django settings for asadb project. |
---|
2 | import os |
---|
3 | import sys |
---|
4 | |
---|
5 | SITE_ROOT = os.path.normpath(os.path.dirname(__file__)) |
---|
6 | SITE_WEB_PATH = '' |
---|
7 | |
---|
8 | DEBUG = False |
---|
9 | TEMPLATE_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.) |
---|
14 | PRODUCTION_DEPLOYMENT = False |
---|
15 | |
---|
16 | ADMINS = ( |
---|
17 | ('ASA Database Team', 'asa-db@mit.edu',), |
---|
18 | ) |
---|
19 | SERVER_EMAIL = 'asa-db-auto@mit.edu' |
---|
20 | DEFAULT_FROM_EMAIL = 'asa-db@mit.edu' |
---|
21 | |
---|
22 | MANAGERS = ADMINS |
---|
23 | |
---|
24 | DATABASES = {} |
---|
25 | |
---|
26 | KRB_KEYTAB = None |
---|
27 | KRB_PRINCIPAL = None |
---|
28 | |
---|
29 | ENABLE_SCRIPTS_AUTH = True |
---|
30 | |
---|
31 | COOKIES_PREFIX = "asadb_" |
---|
32 | SESSION_COOKIE_SECURE = True |
---|
33 | SESSION_COOKIE_HTTPONLY = True |
---|
34 | |
---|
35 | LOGFILE = "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. |
---|
42 | TIME_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 |
---|
46 | LANGUAGE_CODE = 'en-us' |
---|
47 | |
---|
48 | SITE_ID = 1 |
---|
49 | |
---|
50 | # If you set this to False, Django will make some optimizations so as not |
---|
51 | # to load the internationalization machinery. |
---|
52 | USE_I18N = True |
---|
53 | |
---|
54 | DATETIME_FORMAT_PYTHON = "%c" |
---|
55 | |
---|
56 | from local_settings import * |
---|
57 | |
---|
58 | SESSION_COOKIE_NAME = COOKIES_PREFIX + "sessionid" |
---|
59 | CSRF_COOKIE_NAME = COOKIES_PREFIX + "csrftoken" |
---|
60 | |
---|
61 | # Absolute path to the directory that holds media. |
---|
62 | # Example: "/home/media/media.lawrence.com/" |
---|
63 | MEDIA_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/" |
---|
68 | MEDIA_URL = SITE_WEB_PATH + '/media/' |
---|
69 | |
---|
70 | STATIC_URL = SITE_WEB_PATH + '/static/' |
---|
71 | |
---|
72 | # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a |
---|
73 | # trailing slash. |
---|
74 | # Examples: "http://foo.com/media/", "/media/". |
---|
75 | ADMIN_MEDIA_PREFIX = SITE_WEB_PATH + '/media/admin/' |
---|
76 | |
---|
77 | LOGIN_REDIRECT_URL = SITE_WEB_PATH + '/' |
---|
78 | LOGIN_URL = SITE_WEB_PATH + '/accounts/login' |
---|
79 | LOGOUT_URL = SITE_WEB_PATH + '/accounts/logout' |
---|
80 | |
---|
81 | # List of callables that know how to import templates from various sources. |
---|
82 | TEMPLATE_LOADERS = ( |
---|
83 | 'django.template.loaders.filesystem.Loader', |
---|
84 | 'django.template.loaders.app_directories.Loader', |
---|
85 | # 'django.template.loaders.eggs.load_template_source', |
---|
86 | ) |
---|
87 | |
---|
88 | TEMPLATE_CONTEXT_PROCESSORS = ( |
---|
89 | "django.contrib.messages.context_processors.messages", |
---|
90 | "django.contrib.auth.context_processors.auth", |
---|
91 | "django.core.context_processors.debug", |
---|
92 | "django.core.context_processors.i18n", |
---|
93 | "django.core.context_processors.media", |
---|
94 | "django.core.context_processors.request", |
---|
95 | ) |
---|
96 | |
---|
97 | MIDDLEWARE_CLASSES = [ |
---|
98 | 'django.middleware.common.CommonMiddleware', |
---|
99 | 'django.contrib.sessions.middleware.SessionMiddleware', |
---|
100 | 'django.contrib.auth.middleware.AuthenticationMiddleware', |
---|
101 | 'django.middleware.transaction.TransactionMiddleware', |
---|
102 | 'django.middleware.csrf.CsrfViewMiddleware', |
---|
103 | 'reversion.middleware.RevisionMiddleware', |
---|
104 | 'django.contrib.messages.middleware.MessageMiddleware', |
---|
105 | ] |
---|
106 | |
---|
107 | AUTHENTICATION_BACKENDS = [ |
---|
108 | 'groups.models.PerGroupAuthz', |
---|
109 | 'django.contrib.auth.backends.ModelBackend', |
---|
110 | ] |
---|
111 | |
---|
112 | if ENABLE_SCRIPTS_AUTH: |
---|
113 | MIDDLEWARE_CLASSES.append('mit.ScriptsRemoteUserMiddleware') |
---|
114 | AUTHENTICATION_BACKENDS.insert(0, 'mit.ScriptsRemoteUserBackend') |
---|
115 | |
---|
116 | |
---|
117 | ROOT_URLCONF = 'asadb.urls' |
---|
118 | |
---|
119 | TEMPLATE_DIRS = ( |
---|
120 | # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". |
---|
121 | # Always use forward slashes, even on Windows. |
---|
122 | # Don't forget to use absolute paths, not relative paths. |
---|
123 | os.path.join(SITE_ROOT, 'template'), |
---|
124 | ) |
---|
125 | |
---|
126 | INSTALLED_APPS = ( |
---|
127 | 'django.contrib.admin', |
---|
128 | 'django.contrib.admindocs', |
---|
129 | 'django.contrib.auth', |
---|
130 | 'django.contrib.contenttypes', |
---|
131 | 'django.contrib.messages', |
---|
132 | 'django.contrib.sessions', |
---|
133 | 'django.contrib.sites', |
---|
134 | 'form_utils', |
---|
135 | 'django_filters', |
---|
136 | 'reversion', |
---|
137 | 'south', |
---|
138 | 'groups', |
---|
139 | 'forms', |
---|
140 | 'space', |
---|
141 | ) |
---|
142 | |
---|
143 | from local_settings_after import * |
---|