source: asadb/settings.py @ ffecc7f

space-accessstablestage
Last change on this file since ffecc7f was cec082b, checked in by Alex Dehnert <adehnert@…>, 14 years ago

Redirect back to page on login (Trac #68)

See also
http://stackoverflow.com/questions/806835/django-redirect-to-previous-page-after-login.

  • Property mode set to 100644
File size: 3.9 KB
Line 
1# Django settings for asadb project.
2import os
3import sys
4
5SITE_ROOT = os.path.normpath(os.path.dirname(__file__))
6SITE_WEB_PATH = ''
7
8DEBUG = False
9TEMPLATE_DEBUG = DEBUG
10
11# Is this the main, production deployment?
12# If not, we won't try to propagate things to other systems.
13# (For example, no changing asa-official membership.)
14PRODUCTION_DEPLOYMENT = False
15
16ADMINS = (
17    ('ASA Database Team', 'asa-db@mit.edu',),
18)
19SERVER_EMAIL = 'asa-db-auto@mit.edu'
20
21MANAGERS = ADMINS
22
23DATABASES = {}
24
25KRB_KEYTAB = None
26KRB_PRINCIPAL = None
27
28ENABLE_SCRIPTS_AUTH = True
29
30COOKIES_PREFIX = "asadb_"
31SESSION_COOKIE_SECURE = True
32SESSION_COOKIE_HTTPONLY = True
33
34LOGFILE = "asa-db.log"
35
36# Local time zone for this installation. Choices can be found here:
37# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
38# although not all choices may be available on all operating systems.
39# If running in a Windows environment this must be set to the same as your
40# system time zone.
41TIME_ZONE = 'America/New_York'
42
43# Language code for this installation. All choices can be found here:
44# http://www.i18nguy.com/unicode/language-identifiers.html
45LANGUAGE_CODE = 'en-us'
46
47SITE_ID = 1
48
49# If you set this to False, Django will make some optimizations so as not
50# to load the internationalization machinery.
51USE_I18N = True
52
53DATETIME_FORMAT_PYTHON = "%c"
54
55from local_settings import *
56
57SESSION_COOKIE_NAME = COOKIES_PREFIX + "sessionid"
58CSRF_COOKIE_NAME = COOKIES_PREFIX + "csrftoken"
59
60# Absolute path to the directory that holds media.
61# Example: "/home/media/media.lawrence.com/"
62MEDIA_ROOT = SITE_ROOT + '/media/'
63
64# URL that handles the media served from MEDIA_ROOT. Make sure to use a
65# trailing slash if there is a path component (optional in other cases).
66# Examples: "http://media.lawrence.com", "http://example.com/media/"
67MEDIA_URL = SITE_WEB_PATH + '/media/'
68
69# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a
70# trailing slash.
71# Examples: "http://foo.com/media/", "/media/".
72ADMIN_MEDIA_PREFIX = SITE_WEB_PATH + '/media/admin/'
73
74LOGIN_REDIRECT_URL  = SITE_WEB_PATH + '/'
75LOGIN_URL  = SITE_WEB_PATH + '/accounts/login'
76LOGOUT_URL = SITE_WEB_PATH + '/accounts/logout'
77
78# List of callables that know how to import templates from various sources.
79TEMPLATE_LOADERS = (
80    'django.template.loaders.filesystem.Loader',
81    'django.template.loaders.app_directories.load_template_source',
82#     'django.template.loaders.eggs.load_template_source',
83)
84
85TEMPLATE_CONTEXT_PROCESSORS = (
86    "django.core.context_processors.auth",
87    "django.core.context_processors.debug",
88    "django.core.context_processors.i18n",
89    "django.core.context_processors.media",
90    "django.core.context_processors.request",
91)
92
93MIDDLEWARE_CLASSES = [
94    'django.middleware.common.CommonMiddleware',
95    'django.contrib.sessions.middleware.SessionMiddleware',
96    'django.contrib.auth.middleware.AuthenticationMiddleware',
97    'django.middleware.transaction.TransactionMiddleware',
98    'django.middleware.csrf.CsrfViewMiddleware',
99    'reversion.middleware.RevisionMiddleware',
100]
101
102AUTHENTICATION_BACKENDS = [
103    'groups.models.PerGroupAuthz',
104    'django.contrib.auth.backends.ModelBackend',
105]
106
107if ENABLE_SCRIPTS_AUTH:
108    MIDDLEWARE_CLASSES.append('mit.ScriptsRemoteUserMiddleware')
109    AUTHENTICATION_BACKENDS.insert(0, 'mit.ScriptsRemoteUserBackend')
110
111
112ROOT_URLCONF = 'asadb.urls'
113
114TEMPLATE_DIRS = (
115    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
116    # Always use forward slashes, even on Windows.
117    # Don't forget to use absolute paths, not relative paths.
118    'template',
119)
120
121INSTALLED_APPS = (
122    'django.contrib.admin',
123    'django.contrib.admindocs',
124    'django.contrib.auth',
125    'django.contrib.contenttypes',
126    'django.contrib.sessions',
127    'django.contrib.sites',
128    'form_utils',
129    'django_filters',
130    'reversion',
131    'south',
132    'groups',
133    'forms',
134)
135
136from local_settings_after import *
Note: See TracBrowser for help on using the repository browser.