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