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
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'
[6dfcd66]20DEFAULT_FROM_EMAIL = 'asa-db@mit.edu'
[6d06a83]21
22MANAGERS = ADMINS
23
[8bcff9a]24DATABASES = {}
[6d06a83]25
[8d36a62]26KRB_KEYTAB = None
27KRB_PRINCIPAL = None
28
[06e4045]29ENABLE_SCRIPTS_AUTH = True
30
[a586682]31COOKIES_PREFIX = "asadb_"
[d6f7d1a]32SESSION_COOKIE_SECURE = True
33SESSION_COOKIE_HTTPONLY = True
34
[ed938ef]35LOGFILE = "asa-db.log"
36
[6d06a83]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.
[f07e84b]42TIME_ZONE = 'America/New_York'
[6d06a83]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
[aa6a940]54DATETIME_FORMAT_PYTHON = "%c"
55
[5feb719]56from local_settings import *
57
[a586682]58SESSION_COOKIE_NAME = COOKIES_PREFIX + "sessionid"
59CSRF_COOKIE_NAME = COOKIES_PREFIX + "csrftoken"
60
[6d06a83]61# Absolute path to the directory that holds media.
62# Example: "/home/media/media.lawrence.com/"
[8913d43]63MEDIA_ROOT = SITE_ROOT + '/media/'
[6d06a83]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/"
[8913d43]68MEDIA_URL = SITE_WEB_PATH + '/media/'
[6d06a83]69
[ed5797d]70STATIC_URL = SITE_WEB_PATH + '/static/'
71
[6d06a83]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/".
[8913d43]75ADMIN_MEDIA_PREFIX = SITE_WEB_PATH + '/media/admin/'
[6d06a83]76
[1e052c4]77LOGIN_REDIRECT_URL  = SITE_WEB_PATH + '/'
78LOGIN_URL  = SITE_WEB_PATH + '/accounts/login'
79LOGOUT_URL = SITE_WEB_PATH + '/accounts/logout'
80
[6d06a83]81# List of callables that know how to import templates from various sources.
82TEMPLATE_LOADERS = (
[4da2aeb]83    'django.template.loaders.filesystem.Loader',
[7e8ea71]84    'django.template.loaders.app_directories.Loader',
[6d06a83]85#     'django.template.loaders.eggs.load_template_source',
86)
87
[cec082b]88TEMPLATE_CONTEXT_PROCESSORS = (
[7a986f2]89    "django.contrib.messages.context_processors.messages",
[7e8ea71]90    "django.contrib.auth.context_processors.auth",
[cec082b]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
[06e4045]97MIDDLEWARE_CLASSES = [
[6d06a83]98    'django.middleware.common.CommonMiddleware',
99    'django.contrib.sessions.middleware.SessionMiddleware',
100    'django.contrib.auth.middleware.AuthenticationMiddleware',
[8669a34]101    'django.middleware.transaction.TransactionMiddleware',
[c9d8369]102    'django.middleware.csrf.CsrfViewMiddleware',
[3398d3a]103    'reversion.middleware.RevisionMiddleware',
[7a986f2]104    'django.contrib.messages.middleware.MessageMiddleware',
[06e4045]105]
106
107AUTHENTICATION_BACKENDS = [
[16b7515]108    'groups.models.PerGroupAuthz',
[06e4045]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
[6d06a83]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.
[b4cc0cc]123    os.path.join(SITE_ROOT, 'template'),
[6d06a83]124)
125
126INSTALLED_APPS = (
[0c5539a]127    'django.contrib.admin',
128    'django.contrib.admindocs',
[6d06a83]129    'django.contrib.auth',
130    'django.contrib.contenttypes',
[7a986f2]131    'django.contrib.messages',
[6d06a83]132    'django.contrib.sessions',
133    'django.contrib.sites',
[062a126]134    'form_utils',
[1de230f]135    'django_filters',
[3398d3a]136    'reversion',
[25aaeb6]137    'south',
[158cc8d]138    'groups',
[80982de]139    'forms',
[a86a924]140    'space',
[6d06a83]141)
[7e7e7d3]142
143from local_settings_after import *
Note: See TracBrowser for help on using the repository browser.