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