source: remit/settings.py @ 4a9654e

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

Add some useful middlewares

Cargo-culted from the ASA DB. The messages middleware is needed for the admin
as of Django 1.4; not sure about the others.

  • Property mode set to 100644
File size: 3.8 KB
RevLine 
[719e4bb]1# Django settings for treasury project.
[13a23ce]2import os
[92ca60e]3import sys
[13a23ce]4
[cafab4c]5SITE_ROOT = os.path.normpath(os.path.dirname(__file__))
[2ff0d60]6SITE_WEB_PATH = ''
[13a23ce]7DEFAULT_DOMAIN = 'mit.edu'
[a4ac6bd]8
9DEBUG = False
10TEMPLATE_DEBUG = DEBUG
[719e4bb]11
12ADMINS = (
[29e55de]13    ('Remit team', 'remit-default-addr@mit.edu'),
[719e4bb]14)
[29e55de]15SERVER_EMAIL = 'remit-default-addr@mit.edu'
[719e4bb]16
[db191ee]17GROUP_NAME = 'Remit'
[856aac8]18GROUP_ABBR = 'RM'
[db191ee]19SIGNATORY_EMAIL = None
20
[ff0ea05]21CC_SUBMITTER = False
22
[719e4bb]23MANAGERS = ADMINS
24
[6f24604]25BASE_COMMITTEE_PATH = ['Accounts', 'Assets', ]
[857256d]26COMMITTEE_HIERARCHY_LEVELS = 2
[6f24604]27
[dbb39a2]28AUTH_SOCK = None # Path to SocketAuth socket
[1da6cca]29ENABLE_SCRIPTS_AUTH = True
[dbb39a2]30
[70a9bbd]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
[d50ec5b]35SHORT_DATETIME_FORMAT = 'Y-m-d G:i'
36SHORT_DATETIME_FORMAT_F = '%Y-%M-%d %H:%M'
37
[bdc699e]38from local_settings import *
39
[719e4bb]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/"
[cafab4c]59MEDIA_ROOT = SITE_ROOT + '/media/'
[719e4bb]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/"
[2ff0d60]64MEDIA_URL = SITE_WEB_PATH + '/media/'
[719e4bb]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/".
[2ff0d60]69ADMIN_MEDIA_PREFIX = SITE_WEB_PATH + '/media/admin/'
[719e4bb]70
[0f53aae]71LOGIN_REDIRECT_URL  = SITE_WEB_PATH + '/'
[cbf4568]72LOGIN_URL  = SITE_WEB_PATH + '/accounts/login'
73LOGOUT_URL = SITE_WEB_PATH + '/accounts/logout'
74
[719e4bb]75# List of callables that know how to import templates from various sources.
76TEMPLATE_LOADERS = (
[522674a]77    'django.template.loaders.filesystem.Loader',
78    'django.template.loaders.app_directories.Loader',
[719e4bb]79)
80
[1da6cca]81MIDDLEWARE_CLASSES = [
[719e4bb]82    'django.middleware.common.CommonMiddleware',
83    'django.contrib.sessions.middleware.SessionMiddleware',
84    'django.contrib.auth.middleware.AuthenticationMiddleware',
[fe7e946]85    'django.middleware.transaction.TransactionMiddleware',
86    'django.middleware.csrf.CsrfViewMiddleware',
87    'django.contrib.messages.middleware.MessageMiddleware',
[1da6cca]88]
[e68bc7a]89
[dbb39a2]90AUTHENTICATION_BACKENDS = [
[71d716d]91    'django.contrib.auth.backends.ModelBackend',
[dbb39a2]92]
93if AUTH_SOCK:
94    AUTHENTICATION_BACKENDS.insert(1, 'util.SocketAuth.SocketAuthBackend')
[1da6cca]95if ENABLE_SCRIPTS_AUTH:
96    MIDDLEWARE_CLASSES.append('mit.ScriptsRemoteUserMiddleware')
97    AUTHENTICATION_BACKENDS.insert(0, 'mit.ScriptsRemoteUserBackend')
[719e4bb]98
[92ca60e]99ROOT_URLCONF = 'remit.urls'
[719e4bb]100
101TEMPLATE_DIRS = (
102    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
103    # Always use forward slashes, even on Windows.
104    # Don't forget to use absolute paths, not relative paths.
[cafab4c]105    SITE_ROOT + '/templates/',
[32e360b]106    SITE_ROOT + '/remit_templates/',
[719e4bb]107)
108
109INSTALLED_APPS = (
[13a23ce]110    'django.contrib.admin',
111    'django.contrib.admindocs',
[719e4bb]112    'django.contrib.auth',
113    'django.contrib.contenttypes',
114    'django.contrib.sessions',
115    'django.contrib.sites',
[13a23ce]116    'treebeard',
[3111c8a]117    'south',
[13a23ce]118    'vouchers',
[f468e6d]119    'finance_core',
[485673a]120    'util',
[719e4bb]121)
[2ff0d60]122
[3f34670]123EMAIL_SUBJECT_PREFIX = "[Remit: %s] " % (GROUP_ABBR,)
[e8550be]124USER_EMAIL_SIGNATURE = "%s Treasury" % (GROUP_NAME,)
[a9d44e0]125
[2ff0d60]126from local_settings_after import *
Note: See TracBrowser for help on using the repository browser.