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

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

Share project "dj_security" into " http://proj.badc.rl.ac.uk/svn/ndg/mauRepo"

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