SGL avec une premiere implementation de SSO
This commit is contained in:
@@ -12,6 +12,7 @@ https://docs.djangoproject.com/en/5.2/ref/settings/
|
||||
|
||||
from pathlib import Path
|
||||
from os.path import join
|
||||
from decouple import config
|
||||
|
||||
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
||||
BASE_DIR = Path(__file__).resolve().parent.parent
|
||||
@@ -21,13 +22,12 @@ BASE_DIR = Path(__file__).resolve().parent.parent
|
||||
# See https://docs.djangoproject.com/en/5.2/howto/deployment/checklist/
|
||||
|
||||
# SECURITY WARNING: keep the secret key used in production secret!
|
||||
SECRET_KEY = "django-insecure-3mmf81^pt+k6-^dj$n2&*kvf6m09n5i%*+ajv70(ynaxifj5fg"
|
||||
SECRET_KEY = config("SECRET_KEY")
|
||||
|
||||
# SECURITY WARNING: don't run with debug turned on in production!
|
||||
DEBUG = True
|
||||
|
||||
ALLOWED_HOSTS = []
|
||||
DEBUG = config("DEBUG", cast=bool)
|
||||
|
||||
ALLOWED_HOSTS = config("ALLOWED_HOSTS", default=[]).split(",")
|
||||
|
||||
# Application definition
|
||||
|
||||
@@ -44,6 +44,18 @@ INSTALLED_APPS = [
|
||||
"authentification",
|
||||
]
|
||||
|
||||
# LOGIN_URL = '/client/'
|
||||
LOGIN_URL = 'simple-sso-login'
|
||||
|
||||
SIMPLE_SSO_SECRET = config("SIMPLE_SSO_SECRET")
|
||||
SIMPLE_SSO_KEY = config("SIMPLE_SSO_KEY")
|
||||
SIMPLE_SSO_SERVER = config("SIMPLE_SSO_SERVER")
|
||||
#SSO_LOGOUT_URL =
|
||||
|
||||
AUTHENTICATION_BACKENDS = (
|
||||
'django.contrib.auth.backends.ModelBackend',
|
||||
)
|
||||
|
||||
MIDDLEWARE = [
|
||||
"django.middleware.security.SecurityMiddleware",
|
||||
"django.contrib.sessions.middleware.SessionMiddleware",
|
||||
@@ -52,6 +64,8 @@ MIDDLEWARE = [
|
||||
"django.contrib.auth.middleware.AuthenticationMiddleware",
|
||||
"django.contrib.messages.middleware.MessageMiddleware",
|
||||
"django.middleware.clickjacking.XFrameOptionsMiddleware",
|
||||
|
||||
#'simple_sso.sso_client.middleware.PostAuthenticationMiddleware',
|
||||
]
|
||||
|
||||
ROOT_URLCONF = "SGL.urls"
|
||||
@@ -78,13 +92,16 @@ WSGI_APPLICATION = "SGL.wsgi.application"
|
||||
# https://docs.djangoproject.com/en/5.2/ref/settings/#databases
|
||||
|
||||
DATABASES = {
|
||||
"default": {
|
||||
"ENGINE": "django.db.backends.sqlite3",
|
||||
"NAME": BASE_DIR / "db.sqlite3",
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.mysql',
|
||||
'NAME': config("DB_NAME"),
|
||||
'USER': config("DB_USER"),
|
||||
'PASSWORD': config("DB_PASSWORD"),
|
||||
'HOST': config("DB_HOST"),
|
||||
'PORT': config("DB_PORT", default=3306, cast=int),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# Password validation
|
||||
# https://docs.djangoproject.com/en/5.2/ref/settings/#auth-password-validators
|
||||
|
||||
@@ -134,14 +151,12 @@ MEDIA_URL = "/media/"
|
||||
MEDIA_ROOT = BASE_DIR / "media"
|
||||
|
||||
# Gestion de l'envoi des mails
|
||||
EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"
|
||||
EMAIL_HOST = "ssl0.ovh.net"
|
||||
EMAIL_PORT = 465
|
||||
EMAIL_USE_SSL = False
|
||||
EMAIL_USE_TLS = False
|
||||
EMAIL_HOST_USER = "support.it@cerfig.org"
|
||||
EMAIL_HOST_PASSWORD = "Cerfig2025"
|
||||
DEFAULT_FROM_EMAIL = EMAIL_HOST_USER
|
||||
EMAIL_TIMEOUT = 10
|
||||
|
||||
# ALLOWED_HOSTS = ['support.cerfig.org', '41.223.50.187', 'localhost', '127.0.0.1']
|
||||
# EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"
|
||||
# EMAIL_HOST = "ssl0.ovh.net"
|
||||
# EMAIL_PORT = 465
|
||||
# EMAIL_USE_SSL = False
|
||||
# EMAIL_USE_TLS = False
|
||||
# EMAIL_HOST_USER = "support.it@cerfig.org"
|
||||
# EMAIL_HOST_PASSWORD = "Cerfig2025"
|
||||
# DEFAULT_FROM_EMAIL = EMAIL_HOST_USER
|
||||
# EMAIL_TIMEOUT = 10
|
||||
|
||||
Reference in New Issue
Block a user