source: asadb/settings.py

space-accessstablestage
Last change on this file was b4cc0cc, checked in by Alex Dehnert <adehnert@…>, 12 years ago

Use absolute path to templates (ASA-#211)

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