authens/tests/settings.py

54 lines
1.5 KiB
Python
Raw Permalink Normal View History

2020-05-12 21:21:45 +02:00
from django.urls import reverse_lazy # noqa
# Minimal settings to run a django app using authens.
SECRET_KEY = "dummy"
INSTALLED_APPS = [
"django.contrib.contenttypes",
"django.contrib.auth",
2020-05-17 17:36:15 +02:00
"django.contrib.sessions",
2020-05-12 21:21:45 +02:00
"authens",
"tests",
]
AUTHENTICATION_BACKENDS = [
"django.contrib.auth.backends.ModelBackend",
"authens.backends.ENSCASBackend",
2020-06-12 20:39:09 +02:00
"authens.backends.OldCASBackend",
2020-05-12 21:21:45 +02:00
]
2020-05-17 17:36:15 +02:00
MIDDLEWARE = [
2020-06-12 20:39:09 +02:00
"django.middleware.security.SecurityMiddleware",
"django.contrib.sessions.middleware.SessionMiddleware",
"django.middleware.common.CommonMiddleware",
"django.middleware.csrf.CsrfViewMiddleware",
"django.contrib.auth.middleware.AuthenticationMiddleware",
"django.contrib.messages.middleware.MessageMiddleware",
"django.middleware.clickjacking.XFrameOptionsMiddleware",
2020-05-17 17:36:15 +02:00
]
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",
],
},
},
]
2020-05-12 21:21:45 +02:00
DATABASES = {"default": {"ENGINE": "django.db.backends.sqlite3"}}
2020-05-17 17:36:15 +02:00
ROOT_URLCONF = "tests.urls"
2020-05-12 21:21:45 +02:00
LOGIN_URL = reverse_lazy("authens:login")
2020-05-17 21:34:43 +02:00
LOGIN_REDIRECT_URL = "/private"
LOGOUT_REDIRECT_URL = "/public"