Settings: make ready for production

This commit is contained in:
Théophile Bastian 2020-03-26 12:00:43 +01:00
parent 5a662a0eab
commit f3a97f679e
2 changed files with 20 additions and 3 deletions

View file

@ -14,17 +14,17 @@ import os
from .settings_base import * from .settings_base import *
# SECURITY WARNING: keep the secret key used in production secret! # SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = "CHANGE_ME" # FIXME SECRET_KEY = "CHANGE_ME" # FIXME eg. the result of `pwgen 60 1`
# SECURITY WARNING: don't run with debug turned on in production! # SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False DEBUG = False
ALLOWED_HOSTS = [] # FIXME ALLOWED_HOSTS = [] # FIXME eg. `['cas.eleves.ens.fr']`
# Database # Database
# https://docs.djangoproject.com/en/2.1/ref/settings/#databases # https://docs.djangoproject.com/en/2.1/ref/settings/#databases
DATABASES = { # FIXME change to something else DATABASES = { # FIXME change to something else, see URL above
"default": { "default": {
"ENGINE": "django.db.backends.sqlite3", "ENGINE": "django.db.backends.sqlite3",
"NAME": os.path.join(BASE_DIR, "db.sqlite3"), "NAME": os.path.join(BASE_DIR, "db.sqlite3"),
@ -39,3 +39,16 @@ TIME_ZONE = "Europe/Paris"
USE_I18N = True USE_I18N = True
USE_L10N = True USE_L10N = True
USE_TZ = True USE_TZ = True
# CAS backend settings
# See https://github.com/nitmir/django-cas-server#settings
CAS_AUTH_CLASS = "cas_server.auth.LdapAuthUser"
CAS_LDAP_SERVER = "example.com" # FIXME
CAS_LDAP_USER = "" # FIXME or remove if unnecessary
CAS_LDAP_PASSWORD = "" # FIXME or remove if unnecessary
# CAS_LDAP_BASE_DN = "ou=data,dc=example,dc=com"
# CAS_LDAP_USER_QUERY = "(uid=%s)"
# CAS_LDAP_USERNAME_ATTR = "uid" # FIXME
# CAS_LDAP_PASSWORD_ATTR = "userPassword" # FIXME
# CAS_LDAP_PASSWORD_CHECK = "ldap" # FIXME

View file

@ -79,3 +79,7 @@ STATIC_URL = "/static/"
STATIC_ROOT = os.path.join(PUBLIC_DIR, "static") STATIC_ROOT = os.path.join(PUBLIC_DIR, "static")
CAS_SHOW_SERVICE_MESSAGES = False CAS_SHOW_SERVICE_MESSAGES = False
# Internationalization
LOCALE_PATHS = [os.path.join(BASE_DIR, "locale")]