From 69df9780bf41c3508c57e2cfa1b91a75aa6335d8 Mon Sep 17 00:00:00 2001 From: Santiago Lamora Date: Tue, 11 May 2021 13:47:33 +0200 Subject: [PATCH] Update setting MIDDLEWARE_CLASSES to MIDDLEWARE --- .../project_template/project_name/settings.py | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/orchestra/conf/project_template/project_name/settings.py b/orchestra/conf/project_template/project_name/settings.py index 209d91a4..fae6bbc1 100644 --- a/orchestra/conf/project_template/project_name/settings.py +++ b/orchestra/conf/project_template/project_name/settings.py @@ -25,6 +25,7 @@ SECRET_KEY = '{{ secret_key }}' # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True +ALLOWED_HOSTS = [] # Application definition @@ -84,6 +85,21 @@ INSTALLED_APPS = [ ] +MIDDLEWARE = [ + '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', + + 'orchestra.core.caches.RequestCacheMiddleware', + # also handles transations, ATOMIC_REQUESTS does not wrap middlewares + 'orchestra.contrib.orchestration.middlewares.OperationsMiddleware', +] + + ROOT_URLCONF = '{{ project_name }}.urls' TEMPLATES = [ @@ -168,22 +184,6 @@ LOCALE_PATHS = ( ORCHESTRA_SITE_NAME = '{{ project_name }}' -MIDDLEWARE_CLASSES = ( - 'django.contrib.sessions.middleware.SessionMiddleware', - 'django.middleware.common.CommonMiddleware', - 'django.middleware.csrf.CsrfViewMiddleware', - 'django.contrib.auth.middleware.AuthenticationMiddleware', - 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', - # 'django.middleware.locale.LocaleMiddleware' - 'django.contrib.messages.middleware.MessageMiddleware', - 'django.middleware.clickjacking.XFrameOptionsMiddleware', - 'django.middleware.security.SecurityMiddleware', - 'orchestra.core.caches.RequestCacheMiddleware', - # also handles transations, ATOMIC_REQUESTS does not wrap middlewares - 'orchestra.contrib.orchestration.middlewares.OperationsMiddleware', -) - - AUTH_USER_MODEL = 'accounts.Account'