[6d06a83] | 1 | # Django settings for asadb project. |
---|
[8913d43] | 2 | import os |
---|
| 3 | import sys |
---|
| 4 | |
---|
| 5 | SITE_ROOT = os.path.normpath(os.path.dirname(__file__)) |
---|
| 6 | SITE_WEB_PATH = '' |
---|
| 7 | |
---|
[18f99a1] | 8 | DEBUG = False |
---|
[6d06a83] | 9 | TEMPLATE_DEBUG = DEBUG |
---|
| 10 | |
---|
[ea217bd] | 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 | |
---|
[6d06a83] | 16 | ADMINS = ( |
---|
[de11699] | 17 | ('ASA Database Team', 'asa-db@mit.edu',), |
---|
[6d06a83] | 18 | ) |
---|
[4693952] | 19 | SERVER_EMAIL = 'asa-db-auto@mit.edu' |
---|
[6dfcd66] | 20 | DEFAULT_FROM_EMAIL = 'asa-db@mit.edu' |
---|
[6d06a83] | 21 | |
---|
| 22 | MANAGERS = ADMINS |
---|
| 23 | |
---|
[8bcff9a] | 24 | DATABASES = {} |
---|
[6d06a83] | 25 | |
---|
[8d36a62] | 26 | KRB_KEYTAB = None |
---|
| 27 | KRB_PRINCIPAL = None |
---|
| 28 | |
---|
[06e4045] | 29 | ENABLE_SCRIPTS_AUTH = True |
---|
| 30 | |
---|
[a586682] | 31 | COOKIES_PREFIX = "asadb_" |
---|
[d6f7d1a] | 32 | SESSION_COOKIE_SECURE = True |
---|
| 33 | SESSION_COOKIE_HTTPONLY = True |
---|
| 34 | |
---|
[ed938ef] | 35 | LOGFILE = "asa-db.log" |
---|
| 36 | |
---|
[6d06a83] | 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. |
---|
[f07e84b] | 42 | TIME_ZONE = 'America/New_York' |
---|
[6d06a83] | 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 | |
---|
[aa6a940] | 54 | DATETIME_FORMAT_PYTHON = "%c" |
---|
| 55 | |
---|
[5feb719] | 56 | from local_settings import * |
---|
| 57 | |
---|
[a586682] | 58 | SESSION_COOKIE_NAME = COOKIES_PREFIX + "sessionid" |
---|
| 59 | CSRF_COOKIE_NAME = COOKIES_PREFIX + "csrftoken" |
---|
| 60 | |
---|
[6d06a83] | 61 | # Absolute path to the directory that holds media. |
---|
| 62 | # Example: "/home/media/media.lawrence.com/" |
---|
[8913d43] | 63 | MEDIA_ROOT = SITE_ROOT + '/media/' |
---|
[6d06a83] | 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/" |
---|
[8913d43] | 68 | MEDIA_URL = SITE_WEB_PATH + '/media/' |
---|
[6d06a83] | 69 | |
---|
[ed5797d] | 70 | STATIC_URL = SITE_WEB_PATH + '/static/' |
---|
| 71 | |
---|
[6d06a83] | 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/". |
---|
[8913d43] | 75 | ADMIN_MEDIA_PREFIX = SITE_WEB_PATH + '/media/admin/' |
---|
[6d06a83] | 76 | |
---|
[1e052c4] | 77 | LOGIN_REDIRECT_URL = SITE_WEB_PATH + '/' |
---|
| 78 | LOGIN_URL = SITE_WEB_PATH + '/accounts/login' |
---|
| 79 | LOGOUT_URL = SITE_WEB_PATH + '/accounts/logout' |
---|
| 80 | |
---|
[6d06a83] | 81 | # List of callables that know how to import templates from various sources. |
---|
| 82 | TEMPLATE_LOADERS = ( |
---|
[4da2aeb] | 83 | 'django.template.loaders.filesystem.Loader', |
---|
[7e8ea71] | 84 | 'django.template.loaders.app_directories.Loader', |
---|
[6d06a83] | 85 | # 'django.template.loaders.eggs.load_template_source', |
---|
| 86 | ) |
---|
| 87 | |
---|
[cec082b] | 88 | TEMPLATE_CONTEXT_PROCESSORS = ( |
---|
[7a986f2] | 89 | "django.contrib.messages.context_processors.messages", |
---|
[7e8ea71] | 90 | "django.contrib.auth.context_processors.auth", |
---|
[cec082b] | 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 | |
---|
[06e4045] | 97 | MIDDLEWARE_CLASSES = [ |
---|
[6d06a83] | 98 | 'django.middleware.common.CommonMiddleware', |
---|
| 99 | 'django.contrib.sessions.middleware.SessionMiddleware', |
---|
| 100 | 'django.contrib.auth.middleware.AuthenticationMiddleware', |
---|
[8669a34] | 101 | 'django.middleware.transaction.TransactionMiddleware', |
---|
[c9d8369] | 102 | 'django.middleware.csrf.CsrfViewMiddleware', |
---|
[3398d3a] | 103 | 'reversion.middleware.RevisionMiddleware', |
---|
[7a986f2] | 104 | 'django.contrib.messages.middleware.MessageMiddleware', |
---|
[06e4045] | 105 | ] |
---|
| 106 | |
---|
| 107 | AUTHENTICATION_BACKENDS = [ |
---|
[16b7515] | 108 | 'groups.models.PerGroupAuthz', |
---|
[06e4045] | 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 | |
---|
[6d06a83] | 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. |
---|
[b4cc0cc] | 123 | os.path.join(SITE_ROOT, 'template'), |
---|
[6d06a83] | 124 | ) |
---|
| 125 | |
---|
| 126 | INSTALLED_APPS = ( |
---|
[0c5539a] | 127 | 'django.contrib.admin', |
---|
| 128 | 'django.contrib.admindocs', |
---|
[6d06a83] | 129 | 'django.contrib.auth', |
---|
| 130 | 'django.contrib.contenttypes', |
---|
[7a986f2] | 131 | 'django.contrib.messages', |
---|
[6d06a83] | 132 | 'django.contrib.sessions', |
---|
| 133 | 'django.contrib.sites', |
---|
[062a126] | 134 | 'form_utils', |
---|
[1de230f] | 135 | 'django_filters', |
---|
[3398d3a] | 136 | 'reversion', |
---|
[25aaeb6] | 137 | 'south', |
---|
[158cc8d] | 138 | 'groups', |
---|
[80982de] | 139 | 'forms', |
---|
[a86a924] | 140 | 'space', |
---|
[6d06a83] | 141 | ) |
---|
[7e7e7d3] | 142 | |
---|
| 143 | from local_settings_after import * |
---|