[719e4bb] | 1 | # Django settings for treasury project. |
---|
[13a23ce] | 2 | import os |
---|
[92ca60e] | 3 | import sys |
---|
[13a23ce] | 4 | |
---|
[c386673] | 5 | SITE_ROOT = os.path.normpath(os.path.join(os.path.dirname(__file__), '..')) |
---|
[2ff0d60] | 6 | SITE_WEB_PATH = '' |
---|
[13a23ce] | 7 | DEFAULT_DOMAIN = 'mit.edu' |
---|
[a4ac6bd] | 8 | |
---|
| 9 | DEBUG = False |
---|
| 10 | TEMPLATE_DEBUG = DEBUG |
---|
[719e4bb] | 11 | |
---|
[2e4e1fb] | 12 | ATOMIC_REQUESTS = True |
---|
| 13 | |
---|
[719e4bb] | 14 | ADMINS = ( |
---|
[29e55de] | 15 | ('Remit team', 'remit-default-addr@mit.edu'), |
---|
[719e4bb] | 16 | ) |
---|
[29e55de] | 17 | SERVER_EMAIL = 'remit-default-addr@mit.edu' |
---|
[719e4bb] | 18 | |
---|
[db191ee] | 19 | GROUP_NAME = 'Remit' |
---|
[856aac8] | 20 | GROUP_ABBR = 'RM' |
---|
[db191ee] | 21 | SIGNATORY_EMAIL = None |
---|
| 22 | |
---|
[ff0ea05] | 23 | CC_SUBMITTER = False |
---|
| 24 | |
---|
[719e4bb] | 25 | MANAGERS = ADMINS |
---|
| 26 | |
---|
[6f24604] | 27 | BASE_COMMITTEE_PATH = ['Accounts', 'Assets', ] |
---|
[857256d] | 28 | COMMITTEE_HIERARCHY_LEVELS = 2 |
---|
[6f24604] | 29 | |
---|
[dbb39a2] | 30 | AUTH_SOCK = None # Path to SocketAuth socket |
---|
[1da6cca] | 31 | ENABLE_SCRIPTS_AUTH = True |
---|
[dbb39a2] | 32 | |
---|
[70a9bbd] | 33 | # Arguably usual MIME type; text/plain, while wrong, might work better by not |
---|
| 34 | # making browsers want to open in an external application |
---|
| 35 | LATEX_MIMETYPE = 'application/x-latex' |
---|
| 36 | |
---|
[d50ec5b] | 37 | SHORT_DATETIME_FORMAT = 'Y-m-d G:i' |
---|
| 38 | SHORT_DATETIME_FORMAT_F = '%Y-%M-%d %H:%M' |
---|
| 39 | |
---|
[719e4bb] | 40 | # Local time zone for this installation. Choices can be found here: |
---|
| 41 | # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name |
---|
| 42 | # although not all choices may be available on all operating systems. |
---|
| 43 | # If running in a Windows environment this must be set to the same as your |
---|
| 44 | # system time zone. |
---|
[f5bebab] | 45 | TIME_ZONE = 'America/New_York' |
---|
[719e4bb] | 46 | |
---|
| 47 | # Language code for this installation. All choices can be found here: |
---|
| 48 | # http://www.i18nguy.com/unicode/language-identifiers.html |
---|
| 49 | LANGUAGE_CODE = 'en-us' |
---|
| 50 | |
---|
| 51 | SITE_ID = 1 |
---|
| 52 | |
---|
| 53 | # If you set this to False, Django will make some optimizations so as not |
---|
| 54 | # to load the internationalization machinery. |
---|
| 55 | USE_I18N = True |
---|
| 56 | |
---|
[32b9b17] | 57 | # Required settings |
---|
| 58 | # SITE_URL_BASE: used to construct absolute URLs for use in emails |
---|
| 59 | |
---|
[c386673] | 60 | from local import * |
---|
[f5bebab] | 61 | |
---|
[719e4bb] | 62 | # Absolute path to the directory that holds media. |
---|
| 63 | # Example: "/home/media/media.lawrence.com/" |
---|
[cafab4c] | 64 | MEDIA_ROOT = SITE_ROOT + '/media/' |
---|
[719e4bb] | 65 | |
---|
| 66 | # URL that handles the media served from MEDIA_ROOT. Make sure to use a |
---|
| 67 | # trailing slash if there is a path component (optional in other cases). |
---|
| 68 | # Examples: "http://media.lawrence.com", "http://example.com/media/" |
---|
[2ff0d60] | 69 | MEDIA_URL = SITE_WEB_PATH + '/media/' |
---|
[719e4bb] | 70 | |
---|
[f5bebab] | 71 | STATIC_URL = SITE_WEB_PATH + '/static/' |
---|
| 72 | |
---|
[719e4bb] | 73 | # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a |
---|
| 74 | # trailing slash. |
---|
| 75 | # Examples: "http://foo.com/media/", "/media/". |
---|
[2ff0d60] | 76 | ADMIN_MEDIA_PREFIX = SITE_WEB_PATH + '/media/admin/' |
---|
[719e4bb] | 77 | |
---|
[0f53aae] | 78 | LOGIN_REDIRECT_URL = SITE_WEB_PATH + '/' |
---|
[cbf4568] | 79 | LOGIN_URL = SITE_WEB_PATH + '/accounts/login' |
---|
| 80 | LOGOUT_URL = SITE_WEB_PATH + '/accounts/logout' |
---|
| 81 | |
---|
[719e4bb] | 82 | # List of callables that know how to import templates from various sources. |
---|
| 83 | TEMPLATE_LOADERS = ( |
---|
[522674a] | 84 | 'django.template.loaders.filesystem.Loader', |
---|
| 85 | 'django.template.loaders.app_directories.Loader', |
---|
[719e4bb] | 86 | ) |
---|
| 87 | |
---|
[1da6cca] | 88 | MIDDLEWARE_CLASSES = [ |
---|
[719e4bb] | 89 | 'django.middleware.common.CommonMiddleware', |
---|
| 90 | 'django.contrib.sessions.middleware.SessionMiddleware', |
---|
| 91 | 'django.contrib.auth.middleware.AuthenticationMiddleware', |
---|
[fe7e946] | 92 | 'django.middleware.csrf.CsrfViewMiddleware', |
---|
| 93 | 'django.contrib.messages.middleware.MessageMiddleware', |
---|
[1da6cca] | 94 | ] |
---|
[e68bc7a] | 95 | |
---|
[dbb39a2] | 96 | AUTHENTICATION_BACKENDS = [ |
---|
[71d716d] | 97 | 'django.contrib.auth.backends.ModelBackend', |
---|
[dbb39a2] | 98 | ] |
---|
| 99 | if AUTH_SOCK: |
---|
| 100 | AUTHENTICATION_BACKENDS.insert(1, 'util.SocketAuth.SocketAuthBackend') |
---|
[1da6cca] | 101 | if ENABLE_SCRIPTS_AUTH: |
---|
| 102 | MIDDLEWARE_CLASSES.append('mit.ScriptsRemoteUserMiddleware') |
---|
| 103 | AUTHENTICATION_BACKENDS.insert(0, 'mit.ScriptsRemoteUserBackend') |
---|
[719e4bb] | 104 | |
---|
[92ca60e] | 105 | ROOT_URLCONF = 'remit.urls' |
---|
[719e4bb] | 106 | |
---|
| 107 | TEMPLATE_DIRS = ( |
---|
| 108 | # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". |
---|
| 109 | # Always use forward slashes, even on Windows. |
---|
| 110 | # Don't forget to use absolute paths, not relative paths. |
---|
[cafab4c] | 111 | SITE_ROOT + '/templates/', |
---|
[32e360b] | 112 | SITE_ROOT + '/remit_templates/', |
---|
[719e4bb] | 113 | ) |
---|
| 114 | |
---|
| 115 | INSTALLED_APPS = ( |
---|
[13a23ce] | 116 | 'django.contrib.admin', |
---|
| 117 | 'django.contrib.admindocs', |
---|
[719e4bb] | 118 | 'django.contrib.auth', |
---|
| 119 | 'django.contrib.contenttypes', |
---|
| 120 | 'django.contrib.sessions', |
---|
| 121 | 'django.contrib.sites', |
---|
[6479b5c] | 122 | 'django.contrib.staticfiles', |
---|
[13a23ce] | 123 | 'treebeard', |
---|
[3111c8a] | 124 | 'south', |
---|
[13a23ce] | 125 | 'vouchers', |
---|
[f468e6d] | 126 | 'finance_core', |
---|
[485673a] | 127 | 'util', |
---|
[719e4bb] | 128 | ) |
---|
[2ff0d60] | 129 | |
---|
[3f34670] | 130 | EMAIL_SUBJECT_PREFIX = "[Remit: %s] " % (GROUP_ABBR,) |
---|
[e8550be] | 131 | USER_EMAIL_SIGNATURE = "%s Treasury" % (GROUP_NAME,) |
---|
[a9d44e0] | 132 | |
---|
[c386673] | 133 | from local_after import * |
---|