2d4eda396b84d94f8a4f7e765a70ed77112cde4d
[django-cas-provider.git] / cas_provider_examples / simple / settings.py
1 from __future__ import unicode_literals
2
3 from django import VERSION
4
5 # Django settings for xxx project.
6
7 DEBUG = True
8 TEMPLATE_DEBUG = DEBUG
9
10 ADMINS = (
11     # ('Your Name', 'your_email@example.com'),
12 )
13
14 MANAGERS = ADMINS
15
16 import os
17
18 DATABASES = {
19     'default': {
20         'ENGINE': 'django.db.backends.sqlite3',
21         'NAME': os.path.join(os.path.realpath(__file__), 'db'),
22     }
23 }
24
25 # Local time zone for this installation. Choices can be found here:
26 # http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
27 # although not all choices may be available on all operating systems.
28 # On Unix systems, a value of None will cause Django to use the same
29 # timezone as the operating system.
30 # If running in a Windows environment this must be set to the same as your
31 # system time zone.
32 TIME_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
36 LANGUAGE_CODE = 'en-us'
37
38 SITE_ID = 1
39
40 # If you set this to False, Django will make some optimizations so as not
41 # to load the internationalization machinery.
42 USE_I18N = True
43
44 # If you set this to False, Django will not format dates, numbers and
45 # calendars according to the current locale
46 USE_L10N = True
47
48 # Absolute filesystem path to the directory that will hold user-uploaded files.
49 # Example: "/home/media/media.lawrence.com/media/"
50 MEDIA_ROOT = ''
51
52 # URL that handles the media served from MEDIA_ROOT. Make sure to use a
53 # trailing slash.
54 # Examples: "http://media.lawrence.com/media/", "http://example.com/media/"
55 MEDIA_URL = ''
56
57 # Absolute path to the directory static files should be collected to.
58 # Don't put anything in this directory yourself; store your static files
59 # in apps' "static/" subdirectories and in STATICFILES_DIRS.
60 # Example: "/home/media/media.lawrence.com/static/"
61 STATIC_ROOT = ''
62
63 # URL prefix for static files.
64 # Example: "http://media.lawrence.com/static/"
65 STATIC_URL = '/static/'
66
67 # URL prefix for admin static files -- CSS, JavaScript and images.
68 # Make sure to use a trailing slash.
69 # Examples: "http://foo.com/static/admin/", "/static/admin/".
70 ADMIN_MEDIA_PREFIX = '/static/admin/'
71
72 # Additional locations of static files
73 STATICFILES_DIRS = (
74     # Put strings here, like "/home/html/static" or "C:/www/django/static".
75     # Always use forward slashes, even on Windows.
76     # Don't forget to use absolute paths, not relative paths.
77 )
78
79 # List of finder classes that know how to find static files in
80 # various locations.
81 STATICFILES_FINDERS = (
82     'django.contrib.staticfiles.finders.FileSystemFinder',
83     'django.contrib.staticfiles.finders.AppDirectoriesFinder',
84 #    'django.contrib.staticfiles.finders.DefaultStorageFinder',
85 )
86
87 # Make this unique, and don't share it with anybody.
88 SECRET_KEY = 'kv*6pmkq47crqskw%wkst!h7xnisy78zzli@rtklgm#y6o=of!'
89
90 # List of callables that know how to import templates from various sources.
91 TEMPLATE_LOADERS = (
92     'django.template.loaders.filesystem.Loader',
93     'django.template.loaders.app_directories.Loader',
94 #     'django.template.loaders.eggs.Loader',
95 )
96
97 MIDDLEWARE_CLASSES = (
98     'django.middleware.common.CommonMiddleware',
99     'django.contrib.sessions.middleware.SessionMiddleware',
100     'django.middleware.csrf.CsrfViewMiddleware',
101     'django.contrib.auth.middleware.AuthenticationMiddleware',
102     'django.contrib.messages.middleware.MessageMiddleware',
103 )
104
105 ROOT_URLCONF = 'simple.urls'
106
107 import os
108 PROJECT_PATH = os.path.abspath(os.path.dirname(__file__))
109
110 TEMPLATE_DIRS = (
111      os.path.join(PROJECT_PATH, 'templates'),
112 )
113
114 INSTALLED_APPS = (
115     'django.contrib.admin',
116     'django.contrib.auth',
117     'django.contrib.contenttypes',
118     'django.contrib.sessions',
119     'django.contrib.sites',
120     'django.contrib.messages',
121     'django.contrib.staticfiles',
122     'cas_provider',
123     'simple',
124 )
125
126 if VERSION < (1, 7):
127     INSTALLED_APPS += ('south',)
128
129 # A sample logging configuration. The only tangible logging
130 # performed by this configuration is to send an email to
131 # the site admins on every HTTP 500 error.
132 # See http://docs.djangoproject.com/en/dev/topics/logging for
133 # more details on how to customize your logging configuration.
134 LOGGING = {
135     'version': 1,
136     'disable_existing_loggers': False,
137     'handlers': {
138         'mail_admins': {
139             'level': 'ERROR',
140             'class': 'django.utils.log.AdminEmailHandler'
141         }
142     },
143     'loggers': {
144         'django.request': {
145             'handlers': ['mail_admins'],
146             'level': 'ERROR',
147             'propagate': True,
148         },
149     }
150 }