[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 | |
---|
[06e4045] | 85 | MIDDLEWARE_CLASSES = [ |
---|
[6d06a83] | 86 | 'django.middleware.common.CommonMiddleware', |
---|
| 87 | 'django.contrib.sessions.middleware.SessionMiddleware', |
---|
| 88 | 'django.contrib.auth.middleware.AuthenticationMiddleware', |
---|
[8669a34] | 89 | 'django.middleware.transaction.TransactionMiddleware', |
---|
[c9d8369] | 90 | 'django.middleware.csrf.CsrfViewMiddleware', |
---|
[3398d3a] | 91 | 'reversion.middleware.RevisionMiddleware', |
---|
[06e4045] | 92 | ] |
---|
| 93 | |
---|
| 94 | AUTHENTICATION_BACKENDS = [ |
---|
[16b7515] | 95 | 'groups.models.PerGroupAuthz', |
---|
[06e4045] | 96 | 'django.contrib.auth.backends.ModelBackend', |
---|
| 97 | ] |
---|
| 98 | |
---|
| 99 | if ENABLE_SCRIPTS_AUTH: |
---|
| 100 | MIDDLEWARE_CLASSES.append('mit.ScriptsRemoteUserMiddleware') |
---|
| 101 | AUTHENTICATION_BACKENDS.insert(0, 'mit.ScriptsRemoteUserBackend') |
---|
| 102 | |
---|
[6d06a83] | 103 | |
---|
| 104 | ROOT_URLCONF = 'asadb.urls' |
---|
| 105 | |
---|
| 106 | TEMPLATE_DIRS = ( |
---|
| 107 | # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". |
---|
| 108 | # Always use forward slashes, even on Windows. |
---|
| 109 | # Don't forget to use absolute paths, not relative paths. |
---|
[5bd0b4c] | 110 | 'template', |
---|
[6d06a83] | 111 | ) |
---|
| 112 | |
---|
| 113 | INSTALLED_APPS = ( |
---|
[0c5539a] | 114 | 'django.contrib.admin', |
---|
| 115 | 'django.contrib.admindocs', |
---|
[6d06a83] | 116 | 'django.contrib.auth', |
---|
| 117 | 'django.contrib.contenttypes', |
---|
| 118 | 'django.contrib.sessions', |
---|
| 119 | 'django.contrib.sites', |
---|
[062a126] | 120 | 'form_utils', |
---|
[1de230f] | 121 | 'django_filters', |
---|
[3398d3a] | 122 | 'reversion', |
---|
[25aaeb6] | 123 | 'south', |
---|
[158cc8d] | 124 | 'groups', |
---|
[80982de] | 125 | 'forms', |
---|
[a86a924] | 126 | 'space', |
---|
[6d06a83] | 127 | ) |
---|
[7e7e7d3] | 128 | |
---|
| 129 | from local_settings_after import * |
---|