source: mauRepo/dj_security/trunk/dj_security/settings.py @ 8666

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/mauRepo/dj_security/trunk/dj_security/settings.py@8666
Revision 8666, 6.3 KB checked in by mnagni, 7 years ago (diff)

FIxes uncorrect context_processor definition

  • Property svn:mime-type set to text/plain
Line 
1# Django settings for mydjango_secapp project.
2import os
3
4def decode_relative_path(relPath):
5    return os.path.join(os.path.dirname(__file__), relPath).replace('\\', '/') 
6
7DEBUG = True
8TEMPLATE_DEBUG = DEBUG
9
10ADMINS = (
11    # ('Your Name', 'your_email@example.com'),
12)
13MANAGERS = ADMINS
14
15DATABASES = {
16    # This parameters are usually set during
17    # the deployment configuration process
18    'default': {
19        # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.               
20        'ENGINE': 'DB_ENGINE',
21        # Or path to database file if using sqlite3.
22        'NAME': 'DB_NAME',
23        # Not used with sqlite3.                     
24        'USER': 'DB_USER',
25        # Not used with sqlite3.                     
26        'PASSWORD': 'DB_PASSWORD',
27        # Set to empty string for localhost. Not used with sqlite3.       
28        'HOST': 'DB_HOST',                     
29        # Set to empty string for default. Not used with sqlite3.       
30        'PORT': 'DB_PORT',                     
31    }
32}
33
34# Local time zone for this installation. Choices can be found here:
35# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
36# although not all choices may be available on all operating systems.
37# In a Windows environment this must be set to your system time zone.
38TIME_ZONE = 'America/Chicago'
39
40# Language code for this installation. All choices can be found here:
41# http://www.i18nguy.com/unicode/language-identifiers.html
42LANGUAGE_CODE = 'en-us'
43
44SITE_ID = 1
45
46# If you set this to False, Django will make some optimizations so as not
47# to load the internationalization machinery.
48USE_I18N = True
49
50# If you set this to False, Django will not format dates, numbers and
51# calendars according to the current locale.
52USE_L10N = True
53
54# If you set this to False, Django will not use timezone-aware datetimes.
55USE_TZ = True
56
57# Absolute filesystem path to the directory that will hold user-uploaded files.
58# Example: "/home/media/media.lawrence.com/media/"
59MEDIA_ROOT = ''
60
61# URL that handles the media served from MEDIA_ROOT. Make sure to use a
62# trailing slash.
63# Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
64MEDIA_URL = ''
65
66# Absolute path to the directory static files should be collected to.
67# Don't put anything in this directory yourself; store your static files
68# in apps' "static/" subdirectories and in STATICFILES_DIRS.
69# Example: "/home/media/media.lawrence.com/static/"
70STATIC_ROOT = ''
71
72# URL prefix for static files.
73# Example: "http://media.lawrence.com/static/"
74STATIC_URL = '/static/'
75
76# Additional locations of static files
77STATICFILES_DIRS = (
78    # Put strings here, like "/home/html/static" or "C:/www/django/static".
79    # Always use forward slashes, even on Windows.
80    # Don't forget to use absolute paths, not relative paths.
81)
82
83# List of finder classes that know how to find static files in
84# various locations.
85STATICFILES_FINDERS = (
86    'django.contrib.staticfiles.finders.FileSystemFinder',
87    'django.contrib.staticfiles.finders.AppDirectoriesFinder',
88#    'django.contrib.staticfiles.finders.DefaultStorageFinder',
89)
90
91# Make this unique, and don't share it with anybody.
92SECRET_KEY = '=+l)#o$ugq4pc14*$08q5gw(&0@nns@gm&2f=bx0_*jc1+y%w1'
93
94# List of callables that know how to import templates from various sources.
95TEMPLATE_LOADERS = (
96    'django.template.loaders.filesystem.Loader',
97    'django.template.loaders.app_directories.Loader',
98#     'django.template.loaders.eggs.Loader',
99)
100
101MIDDLEWARE_CLASSES = (
102    'django.middleware.common.CommonMiddleware',
103    'django.contrib.sessions.middleware.SessionMiddleware',
104    'django.middleware.csrf.CsrfViewMiddleware',
105    'django.contrib.auth.middleware.AuthenticationMiddleware',
106    'django.contrib.messages.middleware.MessageMiddleware',
107    'django_authopenid.middleware.OpenIDMiddleware',
108    # Uncomment the next line for simple clickjacking protection:
109    # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
110)
111
112ROOT_URLCONF = 'dj_security.urls'
113
114# Python dotted path to the WSGI application used by Django's runserver.
115WSGI_APPLICATION = 'dj_security.wsgi.application'
116
117TEMPLATE_DIRS = (
118    decode_relative_path('static/templates')
119    # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
120    # Always use forward slashes, even on Windows.
121    # Don't forget to use absolute paths, not relative paths.
122)
123
124INSTALLED_APPS = (
125    'django.contrib.auth',
126    'django.contrib.contenttypes',
127    'django.contrib.sessions',
128    #'django.contrib.sites',
129    'django.contrib.messages',
130    'django.contrib.staticfiles',
131    'registration',
132    'django.contrib.humanize',
133    'django_authopenid',
134    'dj_security',
135    # Uncomment the next line to enable the admin:
136    # 'django.contrib.admin',
137    # Uncomment the next line to enable admin documentation:
138    # 'django.contrib.admindocs',
139)
140
141SHARED_SECRET = 'sharedsecret'   
142APPLICATION_ROOT = 'PROJECT_NAME_PAR/'
143if APPLICATION_ROOT.startswith('PROJECT_NAME_'):
144    APPLICATION_ROOT = ''
145   
146# One-week activation window; you may, of course, use a different value.   
147ACCOUNT_ACTIVATION_DAYS = 7
148import socket
149try:
150    HOSTNAME = socket.gethostname()
151except Exception:
152    HOSTNAME = 'localhost'
153URL_ROOT = 'http://' + HOSTNAME + '/' + APPLICATION_ROOT
154
155TEMPLATE_CONTEXT_PROCESSORS = (
156    'django_authopenid.context_processors.authopenid',
157    'django.core.context_processors.i18n',
158    'dj_security.context_processors.settings'
159)
160
161AUTH_PROFILE_MODULE = 'dj_security.UserProfile'
162
163# A sample logging configuration. The only tangible logging
164# performed by this configuration is to send an email to
165# the site admins on every HTTP 500 error when DEBUG=False.
166# See http://docs.djangoproject.com/en/dev/topics/logging for
167# more details on how to customize your logging configuration.
168LOGGING = {
169    'version': 1,
170    'disable_existing_loggers': False,
171    'filters': {
172        'require_debug_false': {
173            '()': 'django.utils.log.RequireDebugFalse'
174        }
175    },
176    'handlers': {
177        'mail_admins': {
178            'level': 'ERROR',
179            'filters': ['require_debug_false'],
180            'class': 'django.utils.log.AdminEmailHandler'
181        }
182    },
183    'loggers': {
184        'django.request': {
185            'handlers': ['mail_admins'],
186            'level': 'ERROR',
187            'propagate': True,
188        },
189    }
190}
191
192import dj_security.dev_settings
Note: See TracBrowser for help on using the repository browser.