source: remit/settings/__init__.py @ 0445831

Last change on this file since 0445831 was 7a292ed, checked in by Alex Dehnert <adehnert@…>, 11 years ago

Add a cautionary note about one setting

Given, eg, remit_templates/vouchers/reimbursementrequest_list.html's use of
budgetarea_pathstr to identify the relevant budget on line 77, those seeking to
change BASE_COMMITTEE_PATH and/or COMMITTEE_HIERARCHY_LEVELS for their
deployment probably need to be careful...

  • Property mode set to 100644
File size: 3.9 KB
Line 
1# Django settings for treasury project.
2import os
3import sys
4
5SITE_ROOT = os.path.normpath(os.path.join(os.path.dirname(__file__), '..'))
6SITE_WEB_PATH = ''
7DEFAULT_DOMAIN = 'mit.edu'
8
9DEBUG = False
10TEMPLATE_DEBUG = DEBUG
11
12ATOMIC_REQUESTS = True
13
14ADMINS = (
15    ('Remit team', 'remit-default-addr@mit.edu'),
16)
17SERVER_EMAIL = 'remit-default-addr@mit.edu'
18
19GROUP_NAME = 'Remit'
20GROUP_ABBR = 'RM'
21SIGNATORY_EMAIL = None
22
23CC_SUBMITTER = False
24
25MANAGERS = ADMINS
26
27# When changing this, be aware of uses of the budgetarea_pathstr filter
28BASE_COMMITTEE_PATH = ['Accounts', 'Assets', ]
29COMMITTEE_HIERARCHY_LEVELS = 2
30
31AUTH_SOCK = None # Path to SocketAuth socket
32ENABLE_SCRIPTS_AUTH = True
33
34# Arguably usual MIME type; text/plain, while wrong, might work better by not
35# making browsers want to open in an external application
36LATEX_MIMETYPE = 'application/x-latex'
37
38SHORT_DATETIME_FORMAT = 'Y-m-d G:i'
39SHORT_DATETIME_FORMAT_F = '%Y-%M-%d %H:%M'
40
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.
46TIME_ZONE = 'America/New_York'
47
48# Language code for this installation. All choices can be found here:
49# http://www.i18nguy.com/unicode/language-identifiers.html
50LANGUAGE_CODE = 'en-us'
51
52SITE_ID = 1
53
54# If you set this to False, Django will make some optimizations so as not
55# to load the internationalization machinery.
56USE_I18N = True
57
58# Required settings
59# SITE_URL_BASE: used to construct absolute URLs for use in emails
60
61from local import *
62
63# Absolute path to the directory that holds media.
64# Example: "/home/media/media.lawrence.com/"
65MEDIA_ROOT = SITE_ROOT + '/media/'
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/"
70MEDIA_URL = SITE_WEB_PATH + '/media/'
71
72STATIC_URL = SITE_WEB_PATH + '/static/'
73
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/".
77ADMIN_MEDIA_PREFIX = SITE_WEB_PATH + '/media/admin/'
78
79LOGIN_REDIRECT_URL  = SITE_WEB_PATH + '/'
80LOGIN_URL  = SITE_WEB_PATH + '/accounts/login'
81LOGOUT_URL = SITE_WEB_PATH + '/accounts/logout'
82
83# List of callables that know how to import templates from various sources.
84TEMPLATE_LOADERS = (
85    'django.template.loaders.filesystem.Loader',
86    'django.template.loaders.app_directories.Loader',
87)
88
89MIDDLEWARE_CLASSES = [
90    'django.middleware.common.CommonMiddleware',
91    'django.contrib.sessions.middleware.SessionMiddleware',
92    'django.contrib.auth.middleware.AuthenticationMiddleware',
93    'django.middleware.csrf.CsrfViewMiddleware',
94    'django.contrib.messages.middleware.MessageMiddleware',
95]
96
97AUTHENTICATION_BACKENDS = [
98    'django.contrib.auth.backends.ModelBackend',
99]
100if AUTH_SOCK:
101    AUTHENTICATION_BACKENDS.insert(1, 'util.SocketAuth.SocketAuthBackend')
102if ENABLE_SCRIPTS_AUTH:
103    MIDDLEWARE_CLASSES.append('mit.ScriptsRemoteUserMiddleware')
104    AUTHENTICATION_BACKENDS.insert(0, 'mit.ScriptsRemoteUserBackend')
105
106ROOT_URLCONF = 'remit.urls'
107
108TEMPLATE_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.
112    SITE_ROOT + '/templates/',
113    SITE_ROOT + '/remit_templates/',
114)
115
116INSTALLED_APPS = (
117    'django.contrib.admin',
118    'django.contrib.admindocs',
119    'django.contrib.auth',
120    'django.contrib.contenttypes',
121    'django.contrib.sessions',
122    'django.contrib.sites',
123    'django.contrib.staticfiles',
124    'treebeard',
125    'south',
126    'vouchers',
127    'finance_core',
128    'util',
129)
130
131EMAIL_SUBJECT_PREFIX = "[Remit: %s] " % (GROUP_ABBR,)
132USER_EMAIL_SIGNATURE = "%s Treasury" % (GROUP_NAME,)
133
134from local_after import *
Note: See TracBrowser for help on using the repository browser.