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

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

Reduced some pylint errors

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