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

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

corrected the email template in order to send the actual URL of the authentication system NOT 'localhost' as before

  • 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)
13MANAGERS = ADMINS
14
15DATABASES = {
16    # This parameters are usually set during the deployment configuration process
17    'default': {
18        'ENGINE': 'DB_ENGINE', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
19        'NAME': 'DB_NAME',                      # Or path to database file if using sqlite3.
20        'USER': 'DB_USER',                      # Not used with sqlite3.
21        'PASSWORD': 'DB_PASSWORD',                  # Not used with sqlite3.
22        'HOST': 'DB_HOST',                      # Set to empty string for localhost. Not used with sqlite3.
23        'PORT': 'DB_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('static/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
134APPLICATION_ROOT = 'PROJECT_NAME_PAR/'
135if APPLICATION_ROOT.startswith('PROJECT_NAME_'):
136    APPLICATION_ROOT = ''
137ACCOUNT_ACTIVATION_DAYS = 7 # One-week activation window; you may, of course, use a different value.
138import socket
139try:
140    HOSTNAME = socket.gethostname()
141except:
142    HOSTNAME = 'localhost'
143URL_ROOT = 'http://' + HOSTNAME + '/' + APPLICATION_ROOT
144
145TEMPLATE_CONTEXT_PROCESSORS = (
146    'django_authopenid.context_processors.authopenid',
147    'django.core.context_processors.i18n',
148    'dj_security.context_processors.settings'
149)
150
151AUTH_PROFILE_MODULE = 'dj_security.UserProfile'
152
153# A sample logging configuration. The only tangible logging
154# performed by this configuration is to send an email to
155# the site admins on every HTTP 500 error when DEBUG=False.
156# See http://docs.djangoproject.com/en/dev/topics/logging for
157# more details on how to customize your logging configuration.
158LOGGING = {
159    'version': 1,
160    'disable_existing_loggers': False,
161    'filters': {
162        'require_debug_false': {
163            '()': 'django.utils.log.RequireDebugFalse'
164        }
165    },
166    'handlers': {
167        'mail_admins': {
168            'level': 'ERROR',
169            'filters': ['require_debug_false'],
170            'class': 'django.utils.log.AdminEmailHandler'
171        }
172    },
173    'loggers': {
174        'django.request': {
175            'handlers': ['mail_admins'],
176            'level': 'ERROR',
177            'propagate': True,
178        },
179    }
180}
181
182import dev_settings
Note: See TracBrowser for help on using the repository browser.