source: remit/settings/__init__.py

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

RFP download/update process (and some tangential changes)

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