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