source: remit/settings.py @ 522674a

client
Last change on this file since 522674a was 522674a, checked in by Alex Dehnert <adehnert@…>, 13 years ago

Switch to class-based template loaders

  • Property mode set to 100644
File size: 3.7 KB
Line 
1# Django settings for treasury project.
2import os
3import sys
4
5SITE_ROOT = os.path.normpath(os.path.dirname(__file__))
6SITE_WEB_PATH = ''
7DEFAULT_DOMAIN = 'mit.edu'
8
9DEBUG = False
10TEMPLATE_DEBUG = DEBUG
11
12ADMINS = (
13    ('Remit team', 'remit-default-addr@mit.edu'),
14)
15SERVER_EMAIL = 'remit-default-addr@mit.edu'
16
17GROUP_NAME = 'Remit'
18GROUP_ABBR = 'RM'
19SIGNATORY_EMAIL = None
20
21CC_SUBMITTER = False
22
23MANAGERS = ADMINS
24
25BASE_COMMITTEE_PATH = ['Accounts', 'Assets', ]
26COMMITTEE_HIERARCHY_LEVELS = 2
27
28AUTH_SOCK = None # Path to SocketAuth socket
29ENABLE_SCRIPTS_AUTH = True
30
31# Arguably usual MIME type; text/plain, while wrong, might work better by not
32# making browsers want to open in an external application
33LATEX_MIMETYPE = 'application/x-latex'
34
35SHORT_DATETIME_FORMAT = 'Y-m-d G:i'
36SHORT_DATETIME_FORMAT_F = '%Y-%M-%d %H:%M'
37
38from local_settings import *
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/Chicago'
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
57# Absolute path to the directory that holds media.
58# Example: "/home/media/media.lawrence.com/"
59MEDIA_ROOT = SITE_ROOT + '/media/'
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/"
64MEDIA_URL = SITE_WEB_PATH + '/media/'
65
66# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
67# trailing slash.
68# Examples: "http://foo.com/media/", "/media/".
69ADMIN_MEDIA_PREFIX = SITE_WEB_PATH + '/media/admin/'
70
71LOGIN_REDIRECT_URL  = SITE_WEB_PATH + '/'
72LOGIN_URL  = SITE_WEB_PATH + '/accounts/login'
73LOGOUT_URL = SITE_WEB_PATH + '/accounts/logout'
74
75# List of callables that know how to import templates from various sources.
76TEMPLATE_LOADERS = (
77    'django.template.loaders.filesystem.Loader',
78    'django.template.loaders.app_directories.Loader',
79)
80
81MIDDLEWARE_CLASSES = [
82    'django.middleware.common.CommonMiddleware',
83    'django.contrib.sessions.middleware.SessionMiddleware',
84    'django.contrib.auth.middleware.AuthenticationMiddleware',
85    #http://docs.djangoproject.com/en/dev/howto/auth-remote-user/
86    #'django.contrib.auth.middleware.RemoteUserMiddleware',
87]
88
89AUTHENTICATION_BACKENDS = [
90    'django.contrib.auth.backends.ModelBackend',
91]
92if AUTH_SOCK:
93    AUTHENTICATION_BACKENDS.insert(1, 'util.SocketAuth.SocketAuthBackend')
94if ENABLE_SCRIPTS_AUTH:
95    MIDDLEWARE_CLASSES.append('mit.ScriptsRemoteUserMiddleware')
96    AUTHENTICATION_BACKENDS.insert(0, 'mit.ScriptsRemoteUserBackend')
97
98ROOT_URLCONF = 'remit.urls'
99
100TEMPLATE_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.
104    SITE_ROOT + '/templates/',
105    SITE_ROOT + '/remit_templates/',
106)
107
108INSTALLED_APPS = (
109    'django.contrib.admin',
110    'django.contrib.admindocs',
111    'django.contrib.auth',
112    'django.contrib.contenttypes',
113    'django.contrib.sessions',
114    'django.contrib.sites',
115    'treebeard',
116    'south',
117    'vouchers',
118    'finance_core',
119    'util',
120)
121
122EMAIL_SUBJECT_PREFIX = "[Remit: %s] " % (GROUP_ABBR,)
123USER_EMAIL_SIGNATURE = "%s Treasury" % (GROUP_NAME,)
124
125from local_settings_after import *
Note: See TracBrowser for help on using the repository browser.