2019-05-08 10:56:49 +02:00
|
|
|
# authentic2 - versatile identity manager
|
|
|
|
# Copyright (C) 2010-2019 Entr'ouvert
|
|
|
|
#
|
|
|
|
# This program is free software: you can redistribute it and/or modify it
|
|
|
|
# under the terms of the GNU Affero General Public License as published
|
|
|
|
# by the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU Affero General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU Affero General Public License
|
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
2015-07-24 11:09:26 +02:00
|
|
|
import logging
|
2015-04-09 11:43:14 +02:00
|
|
|
import logging.config
|
2010-05-31 16:34:21 +02:00
|
|
|
import os
|
2021-03-30 10:15:50 +02:00
|
|
|
|
Simplify settings, remove all extraction from environment (refs #5960)
* Remove loading of settings using YAML
* Remove settings for the debug toolbar
* Remove default TEMPLATE_VARS from settings
* Remove USE_I18N from settings.py, default is already True
* Replace all methods of loading configuration files by the environment
variable DJANGO_CONFIG_FILE
* Remove magic around cache settings
* USE_MEMCACHED is now a normal setting variable, it just configure the
default cache to be memcached and set the session storage to
cached_db.
* Remove extraction of LDAP settings from environment
* Remove extraction of SENTRY_DSN from environment
* Remove extraction of STATIC_ROOT from environment
* Remove settings TEMPLATE_LOADER based on DEBUG
* Remove extraction of all debug related settings from environment
* Remove extraction of ADMINS and MANAGERS from environment
* Remove extraction of DATABASES settings from environment
* Remove extracction of INTERNAL_IPS from environment
* Use Django default for message storage
* Remove platform defaults and extraction from environement for
TEMPLATE_DIRS, STATICFILES_DIRS and LOCALE_PATHS, only keep projects
paths
* Remove extraction from environment for PASSWORD_HASHERS
* Remove extraction of A2_IDP_SAML_ENABLE from environment
* Remove setting variable PROJECT_DIR, PROJECT_NAME, VAR_DIR and ETC_DIR
which are no more used
* Remove defaults from settings.py which have default in app_settings.py
or in Django, or for which we added default value in the code
- A2_ACCEPT_EMAIL_AUTHENTICATION
- A2_CAN_RESET_PASSWORD
- A2_REGISTRATION_CAN_DELETE_ACCOUNT
- A2_REGISTRATION_EMAIL_IS_UNIQUE
- REGISTRATION_OPEN
- ACCOUNT_ACTIVATION_DAYS
- PASSWORD_RESET_TIMEOUT_DAYS
* Set acccount activation days
* Remove SOUTH_TESTS_MIGRATE as we want to test migrations
* Remove all remaining extractions from environment keep only defaults, segregate legacy settings for later removal
* Remove LOCAL_METADATA_CACHE_TIMEOUT from settings
* Remove SENTRY configuration support
* Remove PUSH_PROFILE_UPDATE from settings
* Remove IDP_SAML2 setting, it\'s better to keep supporting it from the debian configuration
* Remove USE_MEMCACHED setting
* Rename settings.py to default_settings.py
* Add minimal default settings allowing to start without a local setting
file
2014-09-21 01:07:08 +02:00
|
|
|
# Load default from Django
|
2018-06-06 16:45:50 +02:00
|
|
|
from django.conf import global_settings
|
2022-09-21 09:31:18 +02:00
|
|
|
from django.utils.translation import gettext_lazy as _
|
2021-03-30 10:38:14 +02:00
|
|
|
|
2015-07-24 11:09:26 +02:00
|
|
|
from . import logger, plugins
|
2014-02-27 11:24:17 +01:00
|
|
|
|
2018-06-06 16:45:50 +02:00
|
|
|
# debian/debian_config.py::extract_settings_from_environ expects CACHES to be in its NAMESPACE
|
|
|
|
CACHES = global_settings.CACHES
|
|
|
|
|
2014-03-21 17:17:03 +01:00
|
|
|
BASE_DIR = os.path.dirname(__file__)
|
2019-05-08 10:56:49 +02:00
|
|
|
|
|
|
|
# Quick-start development settings - unsuitable for production
|
Simplify settings, remove all extraction from environment (refs #5960)
* Remove loading of settings using YAML
* Remove settings for the debug toolbar
* Remove default TEMPLATE_VARS from settings
* Remove USE_I18N from settings.py, default is already True
* Replace all methods of loading configuration files by the environment
variable DJANGO_CONFIG_FILE
* Remove magic around cache settings
* USE_MEMCACHED is now a normal setting variable, it just configure the
default cache to be memcached and set the session storage to
cached_db.
* Remove extraction of LDAP settings from environment
* Remove extraction of SENTRY_DSN from environment
* Remove extraction of STATIC_ROOT from environment
* Remove settings TEMPLATE_LOADER based on DEBUG
* Remove extraction of all debug related settings from environment
* Remove extraction of ADMINS and MANAGERS from environment
* Remove extraction of DATABASES settings from environment
* Remove extracction of INTERNAL_IPS from environment
* Use Django default for message storage
* Remove platform defaults and extraction from environement for
TEMPLATE_DIRS, STATICFILES_DIRS and LOCALE_PATHS, only keep projects
paths
* Remove extraction from environment for PASSWORD_HASHERS
* Remove extraction of A2_IDP_SAML_ENABLE from environment
* Remove setting variable PROJECT_DIR, PROJECT_NAME, VAR_DIR and ETC_DIR
which are no more used
* Remove defaults from settings.py which have default in app_settings.py
or in Django, or for which we added default value in the code
- A2_ACCEPT_EMAIL_AUTHENTICATION
- A2_CAN_RESET_PASSWORD
- A2_REGISTRATION_CAN_DELETE_ACCOUNT
- A2_REGISTRATION_EMAIL_IS_UNIQUE
- REGISTRATION_OPEN
- ACCOUNT_ACTIVATION_DAYS
- PASSWORD_RESET_TIMEOUT_DAYS
* Set acccount activation days
* Remove SOUTH_TESTS_MIGRATE as we want to test migrations
* Remove all remaining extractions from environment keep only defaults, segregate legacy settings for later removal
* Remove LOCAL_METADATA_CACHE_TIMEOUT from settings
* Remove SENTRY configuration support
* Remove PUSH_PROFILE_UPDATE from settings
* Remove IDP_SAML2 setting, it\'s better to keep supporting it from the debian configuration
* Remove USE_MEMCACHED setting
* Rename settings.py to default_settings.py
* Add minimal default settings allowing to start without a local setting
file
2014-09-21 01:07:08 +02:00
|
|
|
# See https://docs.djangoproject.com/en/dev/howto/deployment/checklist/
|
|
|
|
|
|
|
|
# SECURITY WARNING: keep the secret key used in production secret!
|
|
|
|
SECRET_KEY = 'please-change-me-with-a-very-long-random-string'
|
2010-05-31 15:24:53 +02:00
|
|
|
|
Simplify settings, remove all extraction from environment (refs #5960)
* Remove loading of settings using YAML
* Remove settings for the debug toolbar
* Remove default TEMPLATE_VARS from settings
* Remove USE_I18N from settings.py, default is already True
* Replace all methods of loading configuration files by the environment
variable DJANGO_CONFIG_FILE
* Remove magic around cache settings
* USE_MEMCACHED is now a normal setting variable, it just configure the
default cache to be memcached and set the session storage to
cached_db.
* Remove extraction of LDAP settings from environment
* Remove extraction of SENTRY_DSN from environment
* Remove extraction of STATIC_ROOT from environment
* Remove settings TEMPLATE_LOADER based on DEBUG
* Remove extraction of all debug related settings from environment
* Remove extraction of ADMINS and MANAGERS from environment
* Remove extraction of DATABASES settings from environment
* Remove extracction of INTERNAL_IPS from environment
* Use Django default for message storage
* Remove platform defaults and extraction from environement for
TEMPLATE_DIRS, STATICFILES_DIRS and LOCALE_PATHS, only keep projects
paths
* Remove extraction from environment for PASSWORD_HASHERS
* Remove extraction of A2_IDP_SAML_ENABLE from environment
* Remove setting variable PROJECT_DIR, PROJECT_NAME, VAR_DIR and ETC_DIR
which are no more used
* Remove defaults from settings.py which have default in app_settings.py
or in Django, or for which we added default value in the code
- A2_ACCEPT_EMAIL_AUTHENTICATION
- A2_CAN_RESET_PASSWORD
- A2_REGISTRATION_CAN_DELETE_ACCOUNT
- A2_REGISTRATION_EMAIL_IS_UNIQUE
- REGISTRATION_OPEN
- ACCOUNT_ACTIVATION_DAYS
- PASSWORD_RESET_TIMEOUT_DAYS
* Set acccount activation days
* Remove SOUTH_TESTS_MIGRATE as we want to test migrations
* Remove all remaining extractions from environment keep only defaults, segregate legacy settings for later removal
* Remove LOCAL_METADATA_CACHE_TIMEOUT from settings
* Remove SENTRY configuration support
* Remove PUSH_PROFILE_UPDATE from settings
* Remove IDP_SAML2 setting, it\'s better to keep supporting it from the debian configuration
* Remove USE_MEMCACHED setting
* Rename settings.py to default_settings.py
* Add minimal default settings allowing to start without a local setting
file
2014-09-21 01:07:08 +02:00
|
|
|
# SECURITY WARNING: don't run with debug turned on in production!
|
2015-07-24 11:09:26 +02:00
|
|
|
DEBUG = False
|
2015-04-09 11:43:14 +02:00
|
|
|
DEBUG_DB = False
|
Simplify settings, remove all extraction from environment (refs #5960)
* Remove loading of settings using YAML
* Remove settings for the debug toolbar
* Remove default TEMPLATE_VARS from settings
* Remove USE_I18N from settings.py, default is already True
* Replace all methods of loading configuration files by the environment
variable DJANGO_CONFIG_FILE
* Remove magic around cache settings
* USE_MEMCACHED is now a normal setting variable, it just configure the
default cache to be memcached and set the session storage to
cached_db.
* Remove extraction of LDAP settings from environment
* Remove extraction of SENTRY_DSN from environment
* Remove extraction of STATIC_ROOT from environment
* Remove settings TEMPLATE_LOADER based on DEBUG
* Remove extraction of all debug related settings from environment
* Remove extraction of ADMINS and MANAGERS from environment
* Remove extraction of DATABASES settings from environment
* Remove extracction of INTERNAL_IPS from environment
* Use Django default for message storage
* Remove platform defaults and extraction from environement for
TEMPLATE_DIRS, STATICFILES_DIRS and LOCALE_PATHS, only keep projects
paths
* Remove extraction from environment for PASSWORD_HASHERS
* Remove extraction of A2_IDP_SAML_ENABLE from environment
* Remove setting variable PROJECT_DIR, PROJECT_NAME, VAR_DIR and ETC_DIR
which are no more used
* Remove defaults from settings.py which have default in app_settings.py
or in Django, or for which we added default value in the code
- A2_ACCEPT_EMAIL_AUTHENTICATION
- A2_CAN_RESET_PASSWORD
- A2_REGISTRATION_CAN_DELETE_ACCOUNT
- A2_REGISTRATION_EMAIL_IS_UNIQUE
- REGISTRATION_OPEN
- ACCOUNT_ACTIVATION_DAYS
- PASSWORD_RESET_TIMEOUT_DAYS
* Set acccount activation days
* Remove SOUTH_TESTS_MIGRATE as we want to test migrations
* Remove all remaining extractions from environment keep only defaults, segregate legacy settings for later removal
* Remove LOCAL_METADATA_CACHE_TIMEOUT from settings
* Remove SENTRY configuration support
* Remove PUSH_PROFILE_UPDATE from settings
* Remove IDP_SAML2 setting, it\'s better to keep supporting it from the debian configuration
* Remove USE_MEMCACHED setting
* Rename settings.py to default_settings.py
* Add minimal default settings allowing to start without a local setting
file
2014-09-21 01:07:08 +02:00
|
|
|
MEDIA = 'media'
|
2018-09-04 16:26:15 +02:00
|
|
|
MEDIA_ROOT = 'media'
|
|
|
|
MEDIA_URL = '/media/'
|
2010-05-31 15:24:53 +02:00
|
|
|
|
Simplify settings, remove all extraction from environment (refs #5960)
* Remove loading of settings using YAML
* Remove settings for the debug toolbar
* Remove default TEMPLATE_VARS from settings
* Remove USE_I18N from settings.py, default is already True
* Replace all methods of loading configuration files by the environment
variable DJANGO_CONFIG_FILE
* Remove magic around cache settings
* USE_MEMCACHED is now a normal setting variable, it just configure the
default cache to be memcached and set the session storage to
cached_db.
* Remove extraction of LDAP settings from environment
* Remove extraction of SENTRY_DSN from environment
* Remove extraction of STATIC_ROOT from environment
* Remove settings TEMPLATE_LOADER based on DEBUG
* Remove extraction of all debug related settings from environment
* Remove extraction of ADMINS and MANAGERS from environment
* Remove extraction of DATABASES settings from environment
* Remove extracction of INTERNAL_IPS from environment
* Use Django default for message storage
* Remove platform defaults and extraction from environement for
TEMPLATE_DIRS, STATICFILES_DIRS and LOCALE_PATHS, only keep projects
paths
* Remove extraction from environment for PASSWORD_HASHERS
* Remove extraction of A2_IDP_SAML_ENABLE from environment
* Remove setting variable PROJECT_DIR, PROJECT_NAME, VAR_DIR and ETC_DIR
which are no more used
* Remove defaults from settings.py which have default in app_settings.py
or in Django, or for which we added default value in the code
- A2_ACCEPT_EMAIL_AUTHENTICATION
- A2_CAN_RESET_PASSWORD
- A2_REGISTRATION_CAN_DELETE_ACCOUNT
- A2_REGISTRATION_EMAIL_IS_UNIQUE
- REGISTRATION_OPEN
- ACCOUNT_ACTIVATION_DAYS
- PASSWORD_RESET_TIMEOUT_DAYS
* Set acccount activation days
* Remove SOUTH_TESTS_MIGRATE as we want to test migrations
* Remove all remaining extractions from environment keep only defaults, segregate legacy settings for later removal
* Remove LOCAL_METADATA_CACHE_TIMEOUT from settings
* Remove SENTRY configuration support
* Remove PUSH_PROFILE_UPDATE from settings
* Remove IDP_SAML2 setting, it\'s better to keep supporting it from the debian configuration
* Remove USE_MEMCACHED setting
* Rename settings.py to default_settings.py
* Add minimal default settings allowing to start without a local setting
file
2014-09-21 01:07:08 +02:00
|
|
|
# See https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts
|
|
|
|
ALLOWED_HOSTS = []
|
2017-06-25 11:42:18 +02:00
|
|
|
INTERNAL_IPS = ('127.0.0.1',)
|
2013-11-04 09:51:11 +01:00
|
|
|
|
2022-11-23 14:40:04 +01:00
|
|
|
DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
|
|
|
|
|
2010-05-31 15:24:53 +02:00
|
|
|
DATABASES = {
|
|
|
|
'default': {
|
2020-05-02 14:12:38 +02:00
|
|
|
'ENGINE': 'django.db.backends.postgresql_psycopg2',
|
|
|
|
'NAME': 'authentic2',
|
2010-05-31 15:24:53 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-06-14 11:11:20 +02:00
|
|
|
# Hey Entr'ouvert is in France !!
|
2010-05-31 15:24:53 +02:00
|
|
|
TIME_ZONE = 'Europe/Paris'
|
2010-11-24 15:43:22 +01:00
|
|
|
LANGUAGE_CODE = 'fr'
|
2010-05-31 15:24:53 +02:00
|
|
|
USE_L10N = True
|
2015-05-31 02:37:09 +02:00
|
|
|
USE_TZ = True
|
2010-05-31 15:24:53 +02:00
|
|
|
|
2013-06-14 11:11:20 +02:00
|
|
|
# Static files
|
2011-12-08 14:51:15 +01:00
|
|
|
|
Simplify settings, remove all extraction from environment (refs #5960)
* Remove loading of settings using YAML
* Remove settings for the debug toolbar
* Remove default TEMPLATE_VARS from settings
* Remove USE_I18N from settings.py, default is already True
* Replace all methods of loading configuration files by the environment
variable DJANGO_CONFIG_FILE
* Remove magic around cache settings
* USE_MEMCACHED is now a normal setting variable, it just configure the
default cache to be memcached and set the session storage to
cached_db.
* Remove extraction of LDAP settings from environment
* Remove extraction of SENTRY_DSN from environment
* Remove extraction of STATIC_ROOT from environment
* Remove settings TEMPLATE_LOADER based on DEBUG
* Remove extraction of all debug related settings from environment
* Remove extraction of ADMINS and MANAGERS from environment
* Remove extraction of DATABASES settings from environment
* Remove extracction of INTERNAL_IPS from environment
* Use Django default for message storage
* Remove platform defaults and extraction from environement for
TEMPLATE_DIRS, STATICFILES_DIRS and LOCALE_PATHS, only keep projects
paths
* Remove extraction from environment for PASSWORD_HASHERS
* Remove extraction of A2_IDP_SAML_ENABLE from environment
* Remove setting variable PROJECT_DIR, PROJECT_NAME, VAR_DIR and ETC_DIR
which are no more used
* Remove defaults from settings.py which have default in app_settings.py
or in Django, or for which we added default value in the code
- A2_ACCEPT_EMAIL_AUTHENTICATION
- A2_CAN_RESET_PASSWORD
- A2_REGISTRATION_CAN_DELETE_ACCOUNT
- A2_REGISTRATION_EMAIL_IS_UNIQUE
- REGISTRATION_OPEN
- ACCOUNT_ACTIVATION_DAYS
- PASSWORD_RESET_TIMEOUT_DAYS
* Set acccount activation days
* Remove SOUTH_TESTS_MIGRATE as we want to test migrations
* Remove all remaining extractions from environment keep only defaults, segregate legacy settings for later removal
* Remove LOCAL_METADATA_CACHE_TIMEOUT from settings
* Remove SENTRY configuration support
* Remove PUSH_PROFILE_UPDATE from settings
* Remove IDP_SAML2 setting, it\'s better to keep supporting it from the debian configuration
* Remove USE_MEMCACHED setting
* Rename settings.py to default_settings.py
* Add minimal default settings allowing to start without a local setting
file
2014-09-21 01:07:08 +02:00
|
|
|
STATIC_URL = '/static/'
|
2010-05-31 15:24:53 +02:00
|
|
|
|
2018-06-29 14:32:05 +02:00
|
|
|
TEMPLATES = [
|
|
|
|
{
|
|
|
|
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
|
|
|
'DIRS': [
|
|
|
|
os.path.join(BASE_DIR, 'templates'),
|
|
|
|
],
|
|
|
|
'APP_DIRS': True,
|
|
|
|
'OPTIONS': {
|
|
|
|
'context_processors': [
|
|
|
|
'django.contrib.auth.context_processors.auth',
|
2022-11-03 13:39:21 +01:00
|
|
|
'authentic2.a2_rbac.context_processors.auth',
|
2018-07-19 16:16:53 +02:00
|
|
|
'django.template.context_processors.debug',
|
|
|
|
'django.template.context_processors.i18n',
|
|
|
|
'django.template.context_processors.media',
|
|
|
|
'django.template.context_processors.request',
|
2018-06-29 14:32:05 +02:00
|
|
|
'django.contrib.messages.context_processors.messages',
|
2018-07-19 16:16:53 +02:00
|
|
|
'django.template.context_processors.static',
|
2018-06-29 14:32:05 +02:00
|
|
|
'authentic2.context_processors.a2_processor',
|
2022-01-28 00:31:04 +01:00
|
|
|
'authentic2.context_processors.home',
|
2018-06-29 14:32:05 +02:00
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
]
|
|
|
|
|
2010-06-02 14:01:37 +02:00
|
|
|
|
2020-04-01 18:43:42 +02:00
|
|
|
MIDDLEWARE = (
|
2020-10-06 12:40:08 +02:00
|
|
|
'authentic2.middleware.null_character_middleware',
|
2016-03-08 08:01:55 +01:00
|
|
|
'authentic2.middleware.StoreRequestMiddleware',
|
2015-04-09 12:59:33 +02:00
|
|
|
'authentic2.middleware.RequestIdMiddleware',
|
2017-04-27 16:46:28 +02:00
|
|
|
'authentic2.middleware.ServiceAccessControlMiddleware',
|
2020-06-19 15:26:14 +02:00
|
|
|
'authentic2.middleware.CookieTestMiddleware',
|
2010-05-31 15:24:53 +02:00
|
|
|
'django.middleware.common.CommonMiddleware',
|
2011-09-12 16:15:53 +02:00
|
|
|
'django.middleware.http.ConditionalGetMiddleware',
|
2010-05-31 15:24:53 +02:00
|
|
|
'django.contrib.sessions.middleware.SessionMiddleware',
|
2013-04-17 18:08:30 +02:00
|
|
|
'django.middleware.csrf.CsrfViewMiddleware',
|
2010-06-01 11:05:24 +02:00
|
|
|
'django.middleware.locale.LocaleMiddleware',
|
2010-05-31 15:24:53 +02:00
|
|
|
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
|
|
|
'django.contrib.messages.middleware.MessageMiddleware',
|
2020-10-13 19:08:00 +02:00
|
|
|
'authentic2.middleware.journal_middleware',
|
2014-08-05 18:56:07 +02:00
|
|
|
)
|
|
|
|
|
2020-04-01 18:43:42 +02:00
|
|
|
MIDDLEWARE += (
|
2015-07-02 17:33:30 +02:00
|
|
|
'authentic2.middleware.DisplayMessageBeforeRedirectMiddleware',
|
2014-04-08 18:37:53 +02:00
|
|
|
'authentic2.middleware.CollectIPMiddleware',
|
2015-01-29 18:13:22 +01:00
|
|
|
'authentic2.middleware.ViewRestrictionMiddleware',
|
2015-09-25 15:49:25 +02:00
|
|
|
'authentic2.middleware.OpenedSessionCookieMiddleware',
|
2010-05-31 15:24:53 +02:00
|
|
|
)
|
|
|
|
|
2020-04-01 18:43:42 +02:00
|
|
|
MIDDLEWARE = plugins.register_plugins_middleware(MIDDLEWARE)
|
2014-03-14 15:01:58 +01:00
|
|
|
|
2010-10-22 14:35:12 +02:00
|
|
|
ROOT_URLCONF = 'authentic2.urls'
|
2010-05-31 15:24:53 +02:00
|
|
|
|
2018-06-06 16:45:50 +02:00
|
|
|
STATICFILES_FINDERS = list(global_settings.STATICFILES_FINDERS) + ['gadjo.finders.XStaticFinder']
|
2014-07-16 17:22:02 +02:00
|
|
|
|
2019-05-08 10:56:49 +02:00
|
|
|
LOCALE_PATHS = (os.path.join(BASE_DIR, 'locale'),)
|
2010-05-31 15:24:53 +02:00
|
|
|
|
|
|
|
INSTALLED_APPS = (
|
2011-12-08 14:51:15 +01:00
|
|
|
'django.contrib.staticfiles',
|
2016-02-12 10:02:22 +01:00
|
|
|
'django.contrib.contenttypes',
|
2015-05-04 15:31:24 +02:00
|
|
|
'authentic2.custom_user',
|
2010-05-31 15:24:53 +02:00
|
|
|
'django.contrib.auth',
|
|
|
|
'django.contrib.sessions',
|
|
|
|
'django.contrib.messages',
|
2014-03-07 11:12:10 +01:00
|
|
|
'django.contrib.admin',
|
2020-03-12 12:22:57 +01:00
|
|
|
'django.contrib.humanize',
|
2020-09-21 15:11:52 +02:00
|
|
|
'django.contrib.postgres',
|
2014-07-18 20:31:53 +02:00
|
|
|
'django_select2',
|
|
|
|
'django_tables2',
|
2020-06-22 14:54:25 +02:00
|
|
|
'mellon',
|
2020-06-23 14:29:12 +02:00
|
|
|
'authentic2_auth_fc',
|
2020-06-22 14:54:25 +02:00
|
|
|
'authentic2_auth_saml',
|
2020-06-22 15:55:44 +02:00
|
|
|
'authentic2_auth_oidc',
|
2020-06-22 16:19:22 +02:00
|
|
|
'authentic2_idp_cas',
|
2020-06-22 16:36:12 +02:00
|
|
|
'authentic2_idp_oidc',
|
2014-03-07 11:12:10 +01:00
|
|
|
'authentic2.nonce',
|
|
|
|
'authentic2.saml',
|
|
|
|
'authentic2.idp',
|
|
|
|
'authentic2.idp.saml',
|
|
|
|
'authentic2.attribute_aggregator',
|
|
|
|
'authentic2.disco_service',
|
2014-07-18 20:31:53 +02:00
|
|
|
'authentic2.manager',
|
2022-04-13 13:58:05 +02:00
|
|
|
'authentic2.apps.authenticators',
|
2020-08-23 02:28:25 +02:00
|
|
|
'authentic2.apps.journal',
|
2021-07-07 16:11:27 +02:00
|
|
|
'authentic2.backends',
|
2014-03-07 11:12:10 +01:00
|
|
|
'authentic2',
|
2015-05-08 10:05:55 +02:00
|
|
|
'django_rbac',
|
|
|
|
'authentic2.a2_rbac',
|
2014-08-25 18:39:47 +02:00
|
|
|
'gadjo',
|
2015-06-04 17:57:01 +02:00
|
|
|
'rest_framework',
|
2017-03-07 12:09:51 +01:00
|
|
|
'xstatic.pkg.jquery',
|
|
|
|
'xstatic.pkg.jquery_ui',
|
2017-06-08 18:14:45 +02:00
|
|
|
'xstatic.pkg.select2',
|
2021-06-08 17:38:53 +02:00
|
|
|
'django.forms',
|
2010-05-31 15:24:53 +02:00
|
|
|
)
|
2010-05-31 16:55:36 +02:00
|
|
|
|
2015-01-22 10:19:13 +01:00
|
|
|
INSTALLED_APPS = tuple(plugins.register_plugins_installed_apps(INSTALLED_APPS))
|
2014-02-27 11:24:17 +01:00
|
|
|
|
2013-06-14 15:50:10 +02:00
|
|
|
# authentication
|
|
|
|
AUTHENTICATION_BACKENDS = (
|
2019-03-12 12:30:38 +01:00
|
|
|
'authentic2.backends.models_backend.ModelBackend',
|
2014-08-12 09:44:23 +02:00
|
|
|
'authentic2.backends.ldap_backend.LDAPBackend',
|
2015-02-03 15:46:56 +01:00
|
|
|
'authentic2.backends.ldap_backend.LDAPBackendPasswordLost',
|
2015-09-01 10:06:42 +02:00
|
|
|
'authentic2.backends.models_backend.DummyModelBackend',
|
2022-10-06 16:57:40 +02:00
|
|
|
'authentic2.custom_user.backends.DjangoRBACBackend',
|
2020-06-22 14:54:25 +02:00
|
|
|
'authentic2_auth_saml.backends.SAMLBackend',
|
2020-06-22 15:55:44 +02:00
|
|
|
'authentic2_auth_oidc.backends.OIDCBackend',
|
2020-06-23 14:29:12 +02:00
|
|
|
'authentic2_auth_fc.backends.FcBackend',
|
2013-06-14 15:50:10 +02:00
|
|
|
)
|
2019-05-08 10:56:49 +02:00
|
|
|
AUTHENTICATION_BACKENDS = plugins.register_plugins_authentication_backends(AUTHENTICATION_BACKENDS)
|
2014-10-02 21:47:37 +02:00
|
|
|
CSRF_FAILURE_VIEW = 'authentic2.views.csrf_failure_view'
|
|
|
|
|
2013-06-14 15:50:10 +02:00
|
|
|
|
Simplify settings, remove all extraction from environment (refs #5960)
* Remove loading of settings using YAML
* Remove settings for the debug toolbar
* Remove default TEMPLATE_VARS from settings
* Remove USE_I18N from settings.py, default is already True
* Replace all methods of loading configuration files by the environment
variable DJANGO_CONFIG_FILE
* Remove magic around cache settings
* USE_MEMCACHED is now a normal setting variable, it just configure the
default cache to be memcached and set the session storage to
cached_db.
* Remove extraction of LDAP settings from environment
* Remove extraction of SENTRY_DSN from environment
* Remove extraction of STATIC_ROOT from environment
* Remove settings TEMPLATE_LOADER based on DEBUG
* Remove extraction of all debug related settings from environment
* Remove extraction of ADMINS and MANAGERS from environment
* Remove extraction of DATABASES settings from environment
* Remove extracction of INTERNAL_IPS from environment
* Use Django default for message storage
* Remove platform defaults and extraction from environement for
TEMPLATE_DIRS, STATICFILES_DIRS and LOCALE_PATHS, only keep projects
paths
* Remove extraction from environment for PASSWORD_HASHERS
* Remove extraction of A2_IDP_SAML_ENABLE from environment
* Remove setting variable PROJECT_DIR, PROJECT_NAME, VAR_DIR and ETC_DIR
which are no more used
* Remove defaults from settings.py which have default in app_settings.py
or in Django, or for which we added default value in the code
- A2_ACCEPT_EMAIL_AUTHENTICATION
- A2_CAN_RESET_PASSWORD
- A2_REGISTRATION_CAN_DELETE_ACCOUNT
- A2_REGISTRATION_EMAIL_IS_UNIQUE
- REGISTRATION_OPEN
- ACCOUNT_ACTIVATION_DAYS
- PASSWORD_RESET_TIMEOUT_DAYS
* Set acccount activation days
* Remove SOUTH_TESTS_MIGRATE as we want to test migrations
* Remove all remaining extractions from environment keep only defaults, segregate legacy settings for later removal
* Remove LOCAL_METADATA_CACHE_TIMEOUT from settings
* Remove SENTRY configuration support
* Remove PUSH_PROFILE_UPDATE from settings
* Remove IDP_SAML2 setting, it\'s better to keep supporting it from the debian configuration
* Remove USE_MEMCACHED setting
* Rename settings.py to default_settings.py
* Add minimal default settings allowing to start without a local setting
file
2014-09-21 01:07:08 +02:00
|
|
|
LOGIN_REDIRECT_URL = '/'
|
2015-01-22 11:01:04 +01:00
|
|
|
LOGIN_URL = '/login/'
|
|
|
|
LOGOUT_URL = '/logout/'
|
2010-05-31 16:58:15 +02:00
|
|
|
|
Simplify settings, remove all extraction from environment (refs #5960)
* Remove loading of settings using YAML
* Remove settings for the debug toolbar
* Remove default TEMPLATE_VARS from settings
* Remove USE_I18N from settings.py, default is already True
* Replace all methods of loading configuration files by the environment
variable DJANGO_CONFIG_FILE
* Remove magic around cache settings
* USE_MEMCACHED is now a normal setting variable, it just configure the
default cache to be memcached and set the session storage to
cached_db.
* Remove extraction of LDAP settings from environment
* Remove extraction of SENTRY_DSN from environment
* Remove extraction of STATIC_ROOT from environment
* Remove settings TEMPLATE_LOADER based on DEBUG
* Remove extraction of all debug related settings from environment
* Remove extraction of ADMINS and MANAGERS from environment
* Remove extraction of DATABASES settings from environment
* Remove extracction of INTERNAL_IPS from environment
* Use Django default for message storage
* Remove platform defaults and extraction from environement for
TEMPLATE_DIRS, STATICFILES_DIRS and LOCALE_PATHS, only keep projects
paths
* Remove extraction from environment for PASSWORD_HASHERS
* Remove extraction of A2_IDP_SAML_ENABLE from environment
* Remove setting variable PROJECT_DIR, PROJECT_NAME, VAR_DIR and ETC_DIR
which are no more used
* Remove defaults from settings.py which have default in app_settings.py
or in Django, or for which we added default value in the code
- A2_ACCEPT_EMAIL_AUTHENTICATION
- A2_CAN_RESET_PASSWORD
- A2_REGISTRATION_CAN_DELETE_ACCOUNT
- A2_REGISTRATION_EMAIL_IS_UNIQUE
- REGISTRATION_OPEN
- ACCOUNT_ACTIVATION_DAYS
- PASSWORD_RESET_TIMEOUT_DAYS
* Set acccount activation days
* Remove SOUTH_TESTS_MIGRATE as we want to test migrations
* Remove all remaining extractions from environment keep only defaults, segregate legacy settings for later removal
* Remove LOCAL_METADATA_CACHE_TIMEOUT from settings
* Remove SENTRY configuration support
* Remove PUSH_PROFILE_UPDATE from settings
* Remove IDP_SAML2 setting, it\'s better to keep supporting it from the debian configuration
* Remove USE_MEMCACHED setting
* Rename settings.py to default_settings.py
* Add minimal default settings allowing to start without a local setting
file
2014-09-21 01:07:08 +02:00
|
|
|
# Registration
|
|
|
|
ACCOUNT_ACTIVATION_DAYS = 2
|
2013-06-14 11:11:20 +02:00
|
|
|
|
Simplify settings, remove all extraction from environment (refs #5960)
* Remove loading of settings using YAML
* Remove settings for the debug toolbar
* Remove default TEMPLATE_VARS from settings
* Remove USE_I18N from settings.py, default is already True
* Replace all methods of loading configuration files by the environment
variable DJANGO_CONFIG_FILE
* Remove magic around cache settings
* USE_MEMCACHED is now a normal setting variable, it just configure the
default cache to be memcached and set the session storage to
cached_db.
* Remove extraction of LDAP settings from environment
* Remove extraction of SENTRY_DSN from environment
* Remove extraction of STATIC_ROOT from environment
* Remove settings TEMPLATE_LOADER based on DEBUG
* Remove extraction of all debug related settings from environment
* Remove extraction of ADMINS and MANAGERS from environment
* Remove extraction of DATABASES settings from environment
* Remove extracction of INTERNAL_IPS from environment
* Use Django default for message storage
* Remove platform defaults and extraction from environement for
TEMPLATE_DIRS, STATICFILES_DIRS and LOCALE_PATHS, only keep projects
paths
* Remove extraction from environment for PASSWORD_HASHERS
* Remove extraction of A2_IDP_SAML_ENABLE from environment
* Remove setting variable PROJECT_DIR, PROJECT_NAME, VAR_DIR and ETC_DIR
which are no more used
* Remove defaults from settings.py which have default in app_settings.py
or in Django, or for which we added default value in the code
- A2_ACCEPT_EMAIL_AUTHENTICATION
- A2_CAN_RESET_PASSWORD
- A2_REGISTRATION_CAN_DELETE_ACCOUNT
- A2_REGISTRATION_EMAIL_IS_UNIQUE
- REGISTRATION_OPEN
- ACCOUNT_ACTIVATION_DAYS
- PASSWORD_RESET_TIMEOUT_DAYS
* Set acccount activation days
* Remove SOUTH_TESTS_MIGRATE as we want to test migrations
* Remove all remaining extractions from environment keep only defaults, segregate legacy settings for later removal
* Remove LOCAL_METADATA_CACHE_TIMEOUT from settings
* Remove SENTRY configuration support
* Remove PUSH_PROFILE_UPDATE from settings
* Remove IDP_SAML2 setting, it\'s better to keep supporting it from the debian configuration
* Remove USE_MEMCACHED setting
* Rename settings.py to default_settings.py
* Add minimal default settings allowing to start without a local setting
file
2014-09-21 01:07:08 +02:00
|
|
|
# Authentic2 settings
|
2013-06-14 11:11:20 +02:00
|
|
|
|
2011-03-03 11:47:28 +01:00
|
|
|
###########################
|
|
|
|
# Authentication settings
|
|
|
|
###########################
|
2015-04-15 10:51:00 +02:00
|
|
|
AUTH_USER_MODEL = 'custom_user.User'
|
2014-08-07 13:10:45 +02:00
|
|
|
|
2015-05-08 10:05:55 +02:00
|
|
|
###########################
|
|
|
|
# RBAC settings
|
|
|
|
###########################
|
|
|
|
RBAC_OU_MODEL = 'a2_rbac.OrganizationalUnit'
|
|
|
|
RBAC_PERMISSION_MODEL = 'a2_rbac.Permission'
|
|
|
|
RBAC_ROLE_MODEL = 'a2_rbac.Role'
|
|
|
|
RBAC_ROLE_PARENTING_MODEL = 'a2_rbac.RoleParenting'
|
|
|
|
|
2011-03-03 11:47:28 +01:00
|
|
|
#############################
|
|
|
|
# Identity Provider settings
|
|
|
|
#############################
|
|
|
|
|
|
|
|
# List of IdP backends, mainly used to show available services in the homepage
|
|
|
|
# of user, and to handle SLO for each protocols
|
2020-06-18 18:12:48 +02:00
|
|
|
IDP_BACKENDS = ('authentic2.idp.saml.backend.SamlBackend',) + plugins.register_plugins_idp_backends(())
|
2011-03-03 11:47:28 +01:00
|
|
|
|
|
|
|
# Whether to autoload SAML 2.0 identity providers and services metadata
|
|
|
|
# Only https URLS are accepted.
|
2010-10-27 17:52:03 +02:00
|
|
|
# Can be none, sp, idp or both
|
2014-05-26 15:41:05 +02:00
|
|
|
|
2018-06-06 16:45:50 +02:00
|
|
|
PASSWORD_HASHERS = list(global_settings.PASSWORD_HASHERS) + [
|
2019-05-08 10:56:49 +02:00
|
|
|
'authentic2.hashers.Drupal7PasswordHasher',
|
|
|
|
'authentic2.hashers.SHA256PasswordHasher',
|
|
|
|
'authentic2.hashers.SSHA1PasswordHasher',
|
|
|
|
'authentic2.hashers.SMD5PasswordHasher',
|
|
|
|
'authentic2.hashers.SHA1OLDAPPasswordHasher',
|
|
|
|
'authentic2.hashers.MD5OLDAPPasswordHasher',
|
|
|
|
'authentic2.hashers.PloneSHA1PasswordHasher',
|
2018-06-06 16:45:50 +02:00
|
|
|
]
|
2014-05-23 16:13:56 +02:00
|
|
|
|
2015-02-27 16:10:09 +01:00
|
|
|
# Serialization module to support natural keys in generic foreign keys
|
2014-03-27 15:31:25 +01:00
|
|
|
SERIALIZATION_MODULES = {
|
2019-05-08 10:56:49 +02:00
|
|
|
'json': 'authentic2.serializers',
|
2014-03-27 15:31:25 +01:00
|
|
|
}
|
|
|
|
|
2015-04-09 11:43:14 +02:00
|
|
|
LOGGING_CONFIG = None
|
2011-04-26 17:01:23 +02:00
|
|
|
LOGGING = {
|
|
|
|
'version': 1,
|
2015-02-13 15:43:01 +01:00
|
|
|
'disable_existing_loggers': True,
|
2012-04-27 11:20:07 +02:00
|
|
|
'filters': {
|
|
|
|
'cleaning': {
|
2021-07-08 08:19:52 +02:00
|
|
|
'()': 'authentic2.utils.misc.CleanLogMessage',
|
2012-04-27 11:20:07 +02:00
|
|
|
},
|
2015-04-09 11:43:14 +02:00
|
|
|
'request_context': {
|
2019-05-08 10:56:49 +02:00
|
|
|
'()': 'authentic2.log_filters.RequestContextFilter',
|
2015-04-09 11:43:14 +02:00
|
|
|
},
|
2016-06-09 14:01:34 +02:00
|
|
|
'force_debug': {
|
|
|
|
'()': 'authentic2.log_filters.ForceDebugFilter',
|
|
|
|
},
|
2012-04-27 11:20:07 +02:00
|
|
|
},
|
2011-04-26 17:01:23 +02:00
|
|
|
'formatters': {
|
|
|
|
'verbose': {
|
2021-08-10 10:47:28 +02:00
|
|
|
'format': (
|
|
|
|
'[%(asctime)s] %(ip)s %(user)s %(request_id)s %(levelname)s %(name)s.%(funcName)s:'
|
|
|
|
' %(message)s'
|
|
|
|
),
|
2011-04-26 17:01:23 +02:00
|
|
|
'datefmt': '%Y-%m-%d %a %H:%M:%S',
|
|
|
|
},
|
2015-04-28 01:08:20 +02:00
|
|
|
'verbose_db': {
|
|
|
|
'format': '[%(asctime)s] - - - %(levelname)s %(name)s.%(funcName)s: %(message)s',
|
|
|
|
'datefmt': '%Y-%m-%d %a %H:%M:%S',
|
|
|
|
},
|
2011-04-26 17:01:23 +02:00
|
|
|
},
|
|
|
|
'handlers': {
|
|
|
|
'console': {
|
2014-04-03 16:08:13 +02:00
|
|
|
'level': 'DEBUG',
|
2019-05-08 10:56:49 +02:00
|
|
|
'class': 'logging.StreamHandler',
|
2012-04-27 11:20:07 +02:00
|
|
|
'formatter': 'verbose',
|
2015-04-09 11:43:14 +02:00
|
|
|
'filters': ['cleaning', 'request_context'],
|
2011-04-26 17:01:23 +02:00
|
|
|
},
|
2019-05-08 10:56:49 +02:00
|
|
|
# remove request_context filter for db log to prevent infinite loop
|
|
|
|
# when logging sql query to retrieve the session user
|
2015-04-28 01:08:20 +02:00
|
|
|
'console_db': {
|
|
|
|
'level': 'DEBUG',
|
2019-05-08 10:56:49 +02:00
|
|
|
'class': 'logging.StreamHandler',
|
2015-04-28 01:08:20 +02:00
|
|
|
'formatter': 'verbose_db',
|
|
|
|
'filters': ['cleaning'],
|
|
|
|
},
|
2011-04-26 17:01:23 +02:00
|
|
|
},
|
|
|
|
'loggers': {
|
2015-04-09 11:43:14 +02:00
|
|
|
# even when debugging seeing SQL queries is too much, activate it
|
|
|
|
# explicitly using DEBUG_DB
|
|
|
|
'django.db': {
|
2019-05-08 10:56:49 +02:00
|
|
|
'handlers': ['console_db'],
|
|
|
|
'level': logger.SettingsLogLevel('INFO', debug_setting='DEBUG_DB'),
|
|
|
|
'propagate': False,
|
2013-11-14 09:29:39 +01:00
|
|
|
},
|
2016-01-22 12:38:37 +01:00
|
|
|
'django': {
|
2019-05-08 10:56:49 +02:00
|
|
|
'level': 'INFO',
|
2016-01-22 14:05:23 +01:00
|
|
|
},
|
2015-04-09 11:43:14 +02:00
|
|
|
# django_select2 outputs debug message at level INFO
|
|
|
|
'django_select2': {
|
2019-05-08 10:56:49 +02:00
|
|
|
'level': 'WARNING',
|
2014-10-08 17:06:03 +02:00
|
|
|
},
|
2016-06-09 14:01:34 +02:00
|
|
|
# lasso has the bad habit of logging everything as errors
|
2018-06-22 22:45:04 +02:00
|
|
|
'Lasso': {
|
|
|
|
'filters': ['force_debug'],
|
|
|
|
},
|
|
|
|
'libxml2': {
|
|
|
|
'filters': ['force_debug'],
|
|
|
|
},
|
|
|
|
'libxmlsec': {
|
2016-06-09 14:01:34 +02:00
|
|
|
'filters': ['force_debug'],
|
|
|
|
},
|
2015-04-09 11:43:14 +02:00
|
|
|
'': {
|
2019-05-08 10:56:49 +02:00
|
|
|
'handlers': ['console'],
|
|
|
|
'level': logger.SettingsLogLevel('INFO'),
|
2014-10-08 17:06:03 +02:00
|
|
|
},
|
2011-04-26 17:01:23 +02:00
|
|
|
},
|
|
|
|
}
|
2010-06-08 10:49:44 +02:00
|
|
|
|
2015-03-23 16:44:48 +01:00
|
|
|
MIGRATION_MODULES = {
|
2020-04-08 14:44:55 +02:00
|
|
|
'auth': 'authentic2.auth_migrations_18',
|
2015-03-23 16:44:48 +01:00
|
|
|
}
|
|
|
|
|
2015-06-09 10:22:56 +02:00
|
|
|
# Django REST Framework
|
|
|
|
REST_FRAMEWORK = {
|
|
|
|
'NON_FIELD_ERRORS_KEY': '__all__',
|
2022-06-28 21:04:00 +02:00
|
|
|
'DEFAULT_PARSER_CLASSES': [
|
|
|
|
'authentic2.utils.rest_framework.UnflattenJSONParser',
|
|
|
|
'rest_framework.parsers.FormParser',
|
|
|
|
'rest_framework.parsers.MultiPartParser',
|
|
|
|
],
|
2015-11-10 10:32:00 +01:00
|
|
|
'DEFAULT_AUTHENTICATION_CLASSES': (
|
2017-06-08 17:18:10 +02:00
|
|
|
'authentic2.authentication.Authentic2Authentication',
|
2015-11-10 10:32:00 +01:00
|
|
|
'rest_framework.authentication.SessionAuthentication',
|
|
|
|
),
|
|
|
|
'DEFAULT_PERMISSION_CLASSES': ('rest_framework.permissions.IsAuthenticated',),
|
|
|
|
'DEFAULT_FILTER_BACKENDS': (
|
2020-03-12 17:38:01 +01:00
|
|
|
'django_filters.rest_framework.DjangoFilterBackend',
|
2015-11-10 10:32:00 +01:00
|
|
|
'rest_framework.filters.OrderingFilter',
|
|
|
|
),
|
|
|
|
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.LimitOffsetPagination',
|
2017-04-04 10:19:14 +02:00
|
|
|
'PAGE_SIZE': 100,
|
2015-06-09 10:22:56 +02:00
|
|
|
}
|
|
|
|
|
2016-03-02 15:17:07 +01:00
|
|
|
|
|
|
|
# Authentic2 Auth SAML
|
|
|
|
MELLON_ADAPTER = ('authentic2_auth_saml.adapters.AuthenticAdapter',)
|
2021-08-05 13:01:29 +02:00
|
|
|
MELLON_LOOKUP_BY_ATTRIBUTES = [
|
2021-09-28 12:51:25 +02:00
|
|
|
{"saml_attribute": "email", "user_field": "email", "ignore-case": True},
|
2021-08-05 13:01:29 +02:00
|
|
|
{"saml_attribute": "username", "user_field": "username"},
|
|
|
|
]
|
2016-03-02 15:17:07 +01:00
|
|
|
|
2022-08-29 08:33:05 +02:00
|
|
|
# timeout used in python-requests call, in seconds
|
|
|
|
# we use 28s by default: timeout just before web server, which is usually 30s
|
|
|
|
REQUESTS_TIMEOUT = 28
|
|
|
|
|
2017-05-29 14:41:58 +02:00
|
|
|
# Permissions
|
|
|
|
|
|
|
|
DJANGO_RBAC_PERMISSIONS_HIERARCHY = {
|
|
|
|
'view': ['search'],
|
|
|
|
'change_password': ['view', 'search'],
|
2017-12-08 12:47:43 +01:00
|
|
|
'change_email': ['view', 'search'],
|
2017-05-29 14:41:58 +02:00
|
|
|
'reset_password': ['view', 'search'],
|
|
|
|
'activate': ['view', 'search'],
|
|
|
|
'admin': [
|
|
|
|
'change',
|
|
|
|
'delete',
|
|
|
|
'add',
|
|
|
|
'view',
|
|
|
|
'change_password',
|
|
|
|
'reset_password',
|
|
|
|
'activate',
|
2020-09-10 12:24:42 +02:00
|
|
|
'search',
|
|
|
|
'change_email',
|
|
|
|
'manage_members',
|
|
|
|
'manage_authorizations',
|
|
|
|
],
|
2019-10-22 17:31:37 +02:00
|
|
|
'change': ['view', 'search', 'manage_members'],
|
2017-05-29 14:41:58 +02:00
|
|
|
'delete': ['view', 'search'],
|
|
|
|
'add': ['view', 'search'],
|
2019-10-22 17:31:37 +02:00
|
|
|
'manage_members': ['view', 'search'],
|
2020-09-10 12:24:42 +02:00
|
|
|
'manage_authorizations': ['view', 'search'],
|
2017-05-29 14:41:58 +02:00
|
|
|
}
|
2016-03-02 15:17:07 +01:00
|
|
|
|
2021-06-08 17:38:53 +02:00
|
|
|
FORM_RENDERER = 'django.forms.renderers.TemplatesSetting'
|
|
|
|
|
2017-06-25 13:54:01 +02:00
|
|
|
SILENCED_SYSTEM_CHECKS = ["auth.W004"]
|
|
|
|
|
2017-06-10 22:03:36 +02:00
|
|
|
# Get select2 from local copy.
|
2022-04-21 14:42:43 +02:00
|
|
|
SELECT2_JS = '/static/xstatic/select2.min.js'
|
|
|
|
SELECT2_CSS = '/static/xstatic/select2.min.css'
|
2017-06-10 22:03:36 +02:00
|
|
|
|
2022-09-21 09:31:18 +02:00
|
|
|
# Phone prefixes by country for phone number as authentication identifier
|
|
|
|
PHONE_COUNTRY_CODES = {
|
|
|
|
'32': {'lang': 'BE', 'area': _('Belgium')},
|
|
|
|
'33': {'lang': 'FR', 'area': _('Metropolitan France')},
|
|
|
|
'262': {'lang': 'FR', 'area': _('Réunion')},
|
|
|
|
'508': {'lang': 'FR', 'area': _('Saint Pierre and Miquelon')},
|
|
|
|
'590': {'lang': 'FR', 'area': _('Guadeloupe')},
|
|
|
|
'594': {'lang': 'FR', 'area': _('French Guiana')},
|
|
|
|
'596': {'lang': 'FR', 'area': _('Martinique')},
|
|
|
|
}
|
|
|
|
|
|
|
|
DEFAULT_COUNTRY_CODE = '33'
|
|
|
|
|
Simplify settings, remove all extraction from environment (refs #5960)
* Remove loading of settings using YAML
* Remove settings for the debug toolbar
* Remove default TEMPLATE_VARS from settings
* Remove USE_I18N from settings.py, default is already True
* Replace all methods of loading configuration files by the environment
variable DJANGO_CONFIG_FILE
* Remove magic around cache settings
* USE_MEMCACHED is now a normal setting variable, it just configure the
default cache to be memcached and set the session storage to
cached_db.
* Remove extraction of LDAP settings from environment
* Remove extraction of SENTRY_DSN from environment
* Remove extraction of STATIC_ROOT from environment
* Remove settings TEMPLATE_LOADER based on DEBUG
* Remove extraction of all debug related settings from environment
* Remove extraction of ADMINS and MANAGERS from environment
* Remove extraction of DATABASES settings from environment
* Remove extracction of INTERNAL_IPS from environment
* Use Django default for message storage
* Remove platform defaults and extraction from environement for
TEMPLATE_DIRS, STATICFILES_DIRS and LOCALE_PATHS, only keep projects
paths
* Remove extraction from environment for PASSWORD_HASHERS
* Remove extraction of A2_IDP_SAML_ENABLE from environment
* Remove setting variable PROJECT_DIR, PROJECT_NAME, VAR_DIR and ETC_DIR
which are no more used
* Remove defaults from settings.py which have default in app_settings.py
or in Django, or for which we added default value in the code
- A2_ACCEPT_EMAIL_AUTHENTICATION
- A2_CAN_RESET_PASSWORD
- A2_REGISTRATION_CAN_DELETE_ACCOUNT
- A2_REGISTRATION_EMAIL_IS_UNIQUE
- REGISTRATION_OPEN
- ACCOUNT_ACTIVATION_DAYS
- PASSWORD_RESET_TIMEOUT_DAYS
* Set acccount activation days
* Remove SOUTH_TESTS_MIGRATE as we want to test migrations
* Remove all remaining extractions from environment keep only defaults, segregate legacy settings for later removal
* Remove LOCAL_METADATA_CACHE_TIMEOUT from settings
* Remove SENTRY configuration support
* Remove PUSH_PROFILE_UPDATE from settings
* Remove IDP_SAML2 setting, it\'s better to keep supporting it from the debian configuration
* Remove USE_MEMCACHED setting
* Rename settings.py to default_settings.py
* Add minimal default settings allowing to start without a local setting
file
2014-09-21 01:07:08 +02:00
|
|
|
#
|
|
|
|
# Load configuration file
|
|
|
|
#
|
|
|
|
|
2015-02-13 15:08:45 +01:00
|
|
|
if 'AUTHENTIC2_SETTINGS_FILE' in os.environ:
|
2019-03-06 17:35:56 +01:00
|
|
|
with open(os.environ['AUTHENTIC2_SETTINGS_FILE']) as fd:
|
|
|
|
exec(fd.read())
|
2015-04-09 11:43:14 +02:00
|
|
|
logging.config.dictConfig(LOGGING)
|