[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' |
---|
[719e4bb] | 8 | |
---|
| 9 | ADMINS = ( |
---|
[bdc699e] | 10 | ('Remit team', 'remit@mit.edu'), |
---|
[719e4bb] | 11 | ) |
---|
[a4af17d] | 12 | SERVER_EMAIL = 'remit@mit.edu' |
---|
[719e4bb] | 13 | |
---|
[db191ee] | 14 | GROUP_NAME = 'Remit' |
---|
[856aac8] | 15 | GROUP_ABBR = 'RM' |
---|
[db191ee] | 16 | SIGNATORY_EMAIL = None |
---|
| 17 | |
---|
[719e4bb] | 18 | MANAGERS = ADMINS |
---|
| 19 | |
---|
[13a23ce] | 20 | DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. |
---|
[07daa76] | 21 | DATABASE_NAME = os.path.join(SITE_ROOT, 'treasury.sqlite') # Or path to database file if using sqlite3. |
---|
[719e4bb] | 22 | DATABASE_USER = '' # Not used with sqlite3. |
---|
| 23 | DATABASE_PASSWORD = '' # Not used with sqlite3. |
---|
| 24 | DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3. |
---|
| 25 | DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3. |
---|
| 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 | |
---|
[bdc699e] | 37 | from local_settings import * |
---|
| 38 | |
---|
[719e4bb] | 39 | # Local time zone for this installation. Choices can be found here: |
---|
| 40 | # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name |
---|
| 41 | # although not all choices may be available on all operating systems. |
---|
| 42 | # If running in a Windows environment this must be set to the same as your |
---|
| 43 | # system time zone. |
---|
| 44 | TIME_ZONE = 'America/Chicago' |
---|
| 45 | |
---|
| 46 | # Language code for this installation. All choices can be found here: |
---|
| 47 | # http://www.i18nguy.com/unicode/language-identifiers.html |
---|
| 48 | LANGUAGE_CODE = 'en-us' |
---|
| 49 | |
---|
| 50 | SITE_ID = 1 |
---|
| 51 | |
---|
| 52 | # If you set this to False, Django will make some optimizations so as not |
---|
| 53 | # to load the internationalization machinery. |
---|
| 54 | USE_I18N = True |
---|
| 55 | |
---|
| 56 | # Absolute path to the directory that holds media. |
---|
| 57 | # Example: "/home/media/media.lawrence.com/" |
---|
[cafab4c] | 58 | MEDIA_ROOT = SITE_ROOT + '/media/' |
---|
[719e4bb] | 59 | |
---|
| 60 | # URL that handles the media served from MEDIA_ROOT. Make sure to use a |
---|
| 61 | # trailing slash if there is a path component (optional in other cases). |
---|
| 62 | # Examples: "http://media.lawrence.com", "http://example.com/media/" |
---|
[2ff0d60] | 63 | MEDIA_URL = SITE_WEB_PATH + '/media/' |
---|
[719e4bb] | 64 | |
---|
| 65 | # URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a |
---|
| 66 | # trailing slash. |
---|
| 67 | # Examples: "http://foo.com/media/", "/media/". |
---|
[2ff0d60] | 68 | ADMIN_MEDIA_PREFIX = SITE_WEB_PATH + '/media/admin/' |
---|
[719e4bb] | 69 | |
---|
[0f53aae] | 70 | LOGIN_REDIRECT_URL = SITE_WEB_PATH + '/' |
---|
[cbf4568] | 71 | LOGIN_URL = SITE_WEB_PATH + '/accounts/login' |
---|
| 72 | LOGOUT_URL = SITE_WEB_PATH + '/accounts/logout' |
---|
| 73 | |
---|
[719e4bb] | 74 | # List of callables that know how to import templates from various sources. |
---|
| 75 | TEMPLATE_LOADERS = ( |
---|
| 76 | 'django.template.loaders.filesystem.load_template_source', |
---|
| 77 | 'django.template.loaders.app_directories.load_template_source', |
---|
| 78 | # 'django.template.loaders.eggs.load_template_source', |
---|
| 79 | ) |
---|
| 80 | |
---|
[1da6cca] | 81 | MIDDLEWARE_CLASSES = [ |
---|
[719e4bb] | 82 | 'django.middleware.common.CommonMiddleware', |
---|
| 83 | 'django.contrib.sessions.middleware.SessionMiddleware', |
---|
| 84 | 'django.contrib.auth.middleware.AuthenticationMiddleware', |
---|
[3306b90] | 85 | #http://docs.djangoproject.com/en/dev/howto/auth-remote-user/ |
---|
[cb5f343] | 86 | #'django.contrib.auth.middleware.RemoteUserMiddleware', |
---|
[1da6cca] | 87 | ] |
---|
[e68bc7a] | 88 | |
---|
[dbb39a2] | 89 | AUTHENTICATION_BACKENDS = [ |
---|
[71d716d] | 90 | 'django.contrib.auth.backends.ModelBackend', |
---|
[dbb39a2] | 91 | ] |
---|
| 92 | if AUTH_SOCK: |
---|
| 93 | AUTHENTICATION_BACKENDS.insert(1, 'util.SocketAuth.SocketAuthBackend') |
---|
[1da6cca] | 94 | if ENABLE_SCRIPTS_AUTH: |
---|
| 95 | MIDDLEWARE_CLASSES.append('mit.ScriptsRemoteUserMiddleware') |
---|
| 96 | AUTHENTICATION_BACKENDS.insert(0, 'mit.ScriptsRemoteUserBackend') |
---|
[719e4bb] | 97 | |
---|
[92ca60e] | 98 | ROOT_URLCONF = 'remit.urls' |
---|
[719e4bb] | 99 | |
---|
| 100 | TEMPLATE_DIRS = ( |
---|
| 101 | # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". |
---|
| 102 | # Always use forward slashes, even on Windows. |
---|
| 103 | # Don't forget to use absolute paths, not relative paths. |
---|
[cafab4c] | 104 | SITE_ROOT + '/templates/', |
---|
[32e360b] | 105 | SITE_ROOT + '/remit_templates/', |
---|
[719e4bb] | 106 | ) |
---|
| 107 | |
---|
| 108 | INSTALLED_APPS = ( |
---|
[13a23ce] | 109 | 'django.contrib.admin', |
---|
| 110 | 'django.contrib.admindocs', |
---|
[719e4bb] | 111 | 'django.contrib.auth', |
---|
| 112 | 'django.contrib.contenttypes', |
---|
| 113 | 'django.contrib.sessions', |
---|
| 114 | 'django.contrib.sites', |
---|
[13a23ce] | 115 | 'treebeard', |
---|
[3111c8a] | 116 | 'south', |
---|
[13a23ce] | 117 | 'vouchers', |
---|
[f468e6d] | 118 | 'finance_core', |
---|
[485673a] | 119 | 'util', |
---|
[719e4bb] | 120 | ) |
---|
[2ff0d60] | 121 | |
---|
[3f34670] | 122 | EMAIL_SUBJECT_PREFIX = "[Remit: %s] " % (GROUP_ABBR,) |
---|
[e8550be] | 123 | USER_EMAIL_SIGNATURE = "%s Treasury" % (GROUP_NAME,) |
---|
[a9d44e0] | 124 | |
---|
[2ff0d60] | 125 | from local_settings_after import * |
---|