1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-06-21 01:48:21 +02:00

Use environment rather than hardcoding strings, closes #36

This commit is contained in:
Yohann D'ANELLO
2020-03-11 13:24:48 +01:00
parent 06c97d75a0
commit a128ed4803
8 changed files with 35 additions and 13 deletions

View File

@ -51,12 +51,14 @@ except ImportError:
if "cas" in INSTALLED_APPS:
MIDDLEWARE += ['cas.middleware.CASMiddleware']
# CAS Settings
CAS_SERVER_URL = "https://" + os.getenv("NOTE_URL") + "/cas/"
CAS_AUTO_CREATE_USER = False
CAS_LOGO_URL = "/static/img/Saperlistpopette.png"
CAS_FAVICON_URL = "/static/favicon/favicon-32x32.png"
CAS_SHOW_SERVICE_MESSAGES = True
CAS_SHOW_POWERED = False
CAS_REDIRECT_TO_LOGIN_AFTER_LOGOUT = False
CAS_PROVIDE_URL_TO_LOGOUT = True
CAS_INFO_MESSAGES = {
"cas_explained": {
"message": _(

View File

@ -39,7 +39,7 @@ EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
# EMAIL_HOST_USER = 'change_me'
# EMAIL_HOST_PASSWORD = 'change_me'
SERVER_EMAIL = 'no-reply@example.org'
SERVER_EMAIL = 'no-reply@' + os.getenv("DOMAIN")
# Security settings
SECURE_CONTENT_TYPE_NOSNIFF = False

View File

@ -1,6 +1,8 @@
# Copyright (C) 2018-2020 by BDE ENS Paris-Saclay
# SPDX-License-Identifier: GPL-3.0-or-later
import os
########################
# Production Settings #
########################
@ -37,7 +39,7 @@ EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
# EMAIL_HOST_USER = 'change_me'
# EMAIL_HOST_PASSWORD = 'change_me'
SERVER_EMAIL = 'no-reply@example.org'
SERVER_EMAIL = 'no-reply@' + os.getenv("DOMAIN")
# Security settings
SECURE_CONTENT_TYPE_NOSNIFF = False
@ -49,4 +51,4 @@ X_FRAME_OPTIONS = 'DENY'
SESSION_COOKIE_AGE = 60 * 60 * 3
# CAS Client settings
CAS_SERVER_URL = "https://note.crans.org/cas/"
CAS_SERVER_URL = "https://" + os.getenv("NOTE_URL") + "/cas/"