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

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