[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' |
---|
[6d06a83] | 20 | |
---|
| 21 | MANAGERS = ADMINS |
---|
| 22 | |
---|
[8bcff9a] | 23 | DATABASES = {} |
---|
[6d06a83] | 24 | |
---|
[8d36a62] | 25 | KRB_KEYTAB = None |
---|
| 26 | KRB_PRINCIPAL = None |
---|
| 27 | |
---|
[06e4045] | 28 | ENABLE_SCRIPTS_AUTH = True |
---|
| 29 | |
---|
[a586682] | 30 | COOKIES_PREFIX = "asadb_" |
---|
[d6f7d1a] | 31 | SESSION_COOKIE_SECURE = True |
---|
| 32 | SESSION_COOKIE_HTTPONLY = True |
---|
| 33 | |
---|
[ed938ef] | 34 | LOGFILE = "asa-db.log" |
---|
| 35 | |
---|
[6d06a83] | 36 | # Local time zone for this installation. Choices can be found here: |
---|
| 37 | # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name |
---|
| 38 | # although not all choices may be available on all operating systems. |
---|
| 39 | # If running in a Windows environment this must be set to the same as your |
---|
| 40 | # system time zone. |
---|
[f07e84b] | 41 | TIME_ZONE = 'America/New_York' |
---|
[6d06a83] | 42 | |
---|
| 43 | # Language code for this installation. All choices can be found here: |
---|
| 44 | # http://www.i18nguy.com/unicode/language-identifiers.html |
---|
| 45 | LANGUAGE_CODE = 'en-us' |
---|
| 46 | |
---|
| 47 | SITE_ID = 1 |
---|
| 48 | |
---|
| 49 | # If you set this to False, Django will make some optimizations so as not |
---|
| 50 | # to load the internationalization machinery. |
---|
| 51 | USE_I18N = True |
---|
| 52 | |
---|
[aa6a940] | 53 | DATETIME_FORMAT_PYTHON = "%c" |
---|
| 54 | |
---|
[5feb719] | 55 | from local_settings import * |
---|
| 56 | |
---|
[a586682] | 57 | SESSION_COOKIE_NAME = COOKIES_PREFIX + "sessionid" |
---|
| 58 | CSRF_COOKIE_NAME = COOKIES_PREFIX + "csrftoken" |
---|
| 59 | |
---|
[6d06a83] | 60 | # Absolute path to the directory that holds media. |
---|
| 61 | # Example: "/home/media/media.lawrence.com/" |
---|
[8913d43] | 62 | MEDIA_ROOT = SITE_ROOT + '/media/' |
---|
[6d06a83] | 63 | |
---|
| 64 | # URL that handles the media served from MEDIA_ROOT. Make sure to use a |
---|
| 65 | # trailing slash if there is a path component (optional in other cases). |
---|
| 66 | # Examples: "http://media.lawrence.com", "http://example.com/media/" |
---|
[8913d43] | 67 | MEDIA_URL = SITE_WEB_PATH + '/media/' |
---|
[6d06a83] | 68 | |
---|
| 69 | # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a |
---|
| 70 | # trailing slash. |
---|
| 71 | # Examples: "http://foo.com/media/", "/media/". |
---|
[8913d43] | 72 | ADMIN_MEDIA_PREFIX = SITE_WEB_PATH + '/media/admin/' |
---|
[6d06a83] | 73 | |
---|
[1e052c4] | 74 | LOGIN_REDIRECT_URL = SITE_WEB_PATH + '/' |
---|
| 75 | LOGIN_URL = SITE_WEB_PATH + '/accounts/login' |
---|
| 76 | LOGOUT_URL = SITE_WEB_PATH + '/accounts/logout' |
---|
| 77 | |
---|
[6d06a83] | 78 | # List of callables that know how to import templates from various sources. |
---|
| 79 | TEMPLATE_LOADERS = ( |
---|
[4da2aeb] | 80 | 'django.template.loaders.filesystem.Loader', |
---|
[6d06a83] | 81 | 'django.template.loaders.app_directories.load_template_source', |
---|
| 82 | # 'django.template.loaders.eggs.load_template_source', |
---|
| 83 | ) |
---|
| 84 | |
---|
[cec082b] | 85 | TEMPLATE_CONTEXT_PROCESSORS = ( |
---|
| 86 | "django.core.context_processors.auth", |
---|
| 87 | "django.core.context_processors.debug", |
---|
| 88 | "django.core.context_processors.i18n", |
---|
| 89 | "django.core.context_processors.media", |
---|
| 90 | "django.core.context_processors.request", |
---|
| 91 | ) |
---|
| 92 | |
---|
[06e4045] | 93 | MIDDLEWARE_CLASSES = [ |
---|
[6d06a83] | 94 | 'django.middleware.common.CommonMiddleware', |
---|
| 95 | 'django.contrib.sessions.middleware.SessionMiddleware', |
---|
| 96 | 'django.contrib.auth.middleware.AuthenticationMiddleware', |
---|
[8669a34] | 97 | 'django.middleware.transaction.TransactionMiddleware', |
---|
[c9d8369] | 98 | 'django.middleware.csrf.CsrfViewMiddleware', |
---|
[3398d3a] | 99 | 'reversion.middleware.RevisionMiddleware', |
---|
[06e4045] | 100 | ] |
---|
| 101 | |
---|
| 102 | AUTHENTICATION_BACKENDS = [ |
---|
[16b7515] | 103 | 'groups.models.PerGroupAuthz', |
---|
[06e4045] | 104 | 'django.contrib.auth.backends.ModelBackend', |
---|
| 105 | ] |
---|
| 106 | |
---|
| 107 | if ENABLE_SCRIPTS_AUTH: |
---|
| 108 | MIDDLEWARE_CLASSES.append('mit.ScriptsRemoteUserMiddleware') |
---|
| 109 | AUTHENTICATION_BACKENDS.insert(0, 'mit.ScriptsRemoteUserBackend') |
---|
| 110 | |
---|
[6d06a83] | 111 | |
---|
| 112 | ROOT_URLCONF = 'asadb.urls' |
---|
| 113 | |
---|
| 114 | TEMPLATE_DIRS = ( |
---|
| 115 | # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". |
---|
| 116 | # Always use forward slashes, even on Windows. |
---|
| 117 | # Don't forget to use absolute paths, not relative paths. |
---|
[5bd0b4c] | 118 | 'template', |
---|
[6d06a83] | 119 | ) |
---|
| 120 | |
---|
| 121 | INSTALLED_APPS = ( |
---|
[0c5539a] | 122 | 'django.contrib.admin', |
---|
| 123 | 'django.contrib.admindocs', |
---|
[6d06a83] | 124 | 'django.contrib.auth', |
---|
| 125 | 'django.contrib.contenttypes', |
---|
| 126 | 'django.contrib.sessions', |
---|
| 127 | 'django.contrib.sites', |
---|
[062a126] | 128 | 'form_utils', |
---|
[1de230f] | 129 | 'django_filters', |
---|
[3398d3a] | 130 | 'reversion', |
---|
[25aaeb6] | 131 | 'south', |
---|
[158cc8d] | 132 | 'groups', |
---|
[80982de] | 133 | 'forms', |
---|
[6d06a83] | 134 | ) |
---|
[7e7e7d3] | 135 | |
---|
| 136 | from local_settings_after import * |
---|