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