django-oidc-provider/example_project/myapp/settings.py

92 lines
2.1 KiB
Python
Raw Normal View History

2015-03-19 20:10:00 +00:00
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
2015-08-04 18:34:30 +00:00
SECRET_KEY = 'c14d549c574e4d8cf162404ef0b04598'
2015-03-19 20:10:00 +00:00
2015-08-04 20:56:03 +00:00
DEBUG = True
2015-03-19 20:10:00 +00:00
2015-08-04 18:34:30 +00:00
TEMPLATE_DEBUG = False
2015-03-19 20:10:00 +00:00
2015-08-04 18:34:30 +00:00
ALLOWED_HOSTS = ['*']
2015-03-19 20:10:00 +00:00
# Application definition
INSTALLED_APPS = [
2015-03-19 20:10:00 +00:00
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
2016-09-07 19:02:31 +00:00
'myapp',
2015-03-19 20:10:00 +00:00
'oidc_provider',
]
2015-03-19 20:10:00 +00:00
MIDDLEWARE_CLASSES = [
2015-03-19 20:10:00 +00:00
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
2016-10-28 18:25:52 +00:00
'oidc_provider.middleware.SessionManagementMiddleware',
]
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
2015-03-19 20:10:00 +00:00
2016-09-07 19:02:31 +00:00
ROOT_URLCONF = 'myapp.urls'
2015-03-19 20:10:00 +00:00
2016-09-07 19:02:31 +00:00
WSGI_APPLICATION = 'myapp.wsgi.application'
2015-03-19 20:10:00 +00:00
# Database
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
2015-08-04 18:34:30 +00:00
'NAME': os.path.join(BASE_DIR, 'DATABASE.sqlite3'),
2015-03-19 20:10:00 +00:00
}
}
# Internationalization
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_L10N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
STATIC_URL = '/static/'
2015-08-04 18:34:30 +00:00
STATIC_ROOT = os.path.join(BASE_DIR, 'static/')
# Custom settings
2015-03-19 20:10:00 +00:00
2015-04-30 20:03:39 +00:00
LOGIN_REDIRECT_URL = '/'
2015-03-19 20:10:00 +00:00
2015-08-04 18:34:30 +00:00
# OIDC Provider settings
2015-03-19 20:10:00 +00:00
2015-07-14 16:27:46 +00:00
SITE_URL = 'http://localhost:8000'
2016-10-28 18:25:52 +00:00
OIDC_SESSION_MANAGEMENT_ENABLE = True