source: remit/settings/__init__.py @ 2e4e1fb

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

Use Django 1.6's approach to atomic requests

Really, we should possibly be trying to support Django 1.4 (and 1.5) still, but
transaction-per-request or not isn't crucial, and we don't expect to be running
on Django 1.4 much longer, since Scripts F20 will have 1.6.

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