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

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

Incomplete - # 22686: [CEDA Site Python Port] Resource Registration - support for access to multiple resources
 http://team.ceda.ac.uk/trac/ceda/ticket/22686

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