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
RevLine 
[6d06a83]1# Django settings for asadb project.
[8913d43]2import os
3import sys
4
5SITE_ROOT = os.path.normpath(os.path.dirname(__file__))
6SITE_WEB_PATH = ''
7
[18f99a1]8DEBUG = False
[6d06a83]9TEMPLATE_DEBUG = DEBUG
10
[ea217bd]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
[6d06a83]16ADMINS = (
[de11699]17    ('ASA Database Team', 'asa-db@mit.edu',),
[6d06a83]18)
[4693952]19SERVER_EMAIL = 'asa-db-auto@mit.edu'
[6d06a83]20
21MANAGERS = ADMINS
22
[8bcff9a]23DATABASES = {}
[6d06a83]24
[8d36a62]25KRB_KEYTAB = None
26KRB_PRINCIPAL = None
27
[06e4045]28ENABLE_SCRIPTS_AUTH = True
29
[a586682]30COOKIES_PREFIX = "asadb_"
[d6f7d1a]31SESSION_COOKIE_SECURE = True
32SESSION_COOKIE_HTTPONLY = True
33
[ed938ef]34LOGFILE = "asa-db.log"
35
[6d06a83]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.
[f07e84b]41TIME_ZONE = 'America/New_York'
[6d06a83]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
[aa6a940]53DATETIME_FORMAT_PYTHON = "%c"
54
[5feb719]55from local_settings import *
56
[a586682]57SESSION_COOKIE_NAME = COOKIES_PREFIX + "sessionid"
58CSRF_COOKIE_NAME = COOKIES_PREFIX + "csrftoken"
59
[6d06a83]60# Absolute path to the directory that holds media.
61# Example: "/home/media/media.lawrence.com/"
[8913d43]62MEDIA_ROOT = SITE_ROOT + '/media/'
[6d06a83]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/"
[8913d43]67MEDIA_URL = SITE_WEB_PATH + '/media/'
[6d06a83]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/".
[8913d43]72ADMIN_MEDIA_PREFIX = SITE_WEB_PATH + '/media/admin/'
[6d06a83]73
[1e052c4]74LOGIN_REDIRECT_URL  = SITE_WEB_PATH + '/'
75LOGIN_URL  = SITE_WEB_PATH + '/accounts/login'
76LOGOUT_URL = SITE_WEB_PATH + '/accounts/logout'
77
[6d06a83]78# List of callables that know how to import templates from various sources.
79TEMPLATE_LOADERS = (
[4da2aeb]80    'django.template.loaders.filesystem.Loader',
[6d06a83]81    'django.template.loaders.app_directories.load_template_source',
82#     'django.template.loaders.eggs.load_template_source',
83)
84
[cec082b]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
[06e4045]93MIDDLEWARE_CLASSES = [
[6d06a83]94    'django.middleware.common.CommonMiddleware',
95    'django.contrib.sessions.middleware.SessionMiddleware',
96    'django.contrib.auth.middleware.AuthenticationMiddleware',
[8669a34]97    'django.middleware.transaction.TransactionMiddleware',
[c9d8369]98    'django.middleware.csrf.CsrfViewMiddleware',
[3398d3a]99    'reversion.middleware.RevisionMiddleware',
[06e4045]100]
101
102AUTHENTICATION_BACKENDS = [
[16b7515]103    'groups.models.PerGroupAuthz',
[06e4045]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
[6d06a83]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.
[5bd0b4c]118    'template',
[6d06a83]119)
120
121INSTALLED_APPS = (
[0c5539a]122    'django.contrib.admin',
123    'django.contrib.admindocs',
[6d06a83]124    'django.contrib.auth',
125    'django.contrib.contenttypes',
126    'django.contrib.sessions',
127    'django.contrib.sites',
[062a126]128    'form_utils',
[1de230f]129    'django_filters',
[3398d3a]130    'reversion',
[25aaeb6]131    'south',
[158cc8d]132    'groups',
[80982de]133    'forms',
[6d06a83]134)
[7e7e7d3]135
136from local_settings_after import *
Note: See TracBrowser for help on using the repository browser.