coverage, debug toolbar only for debug
This commit is contained in:
parent
8a2fbfc160
commit
15c6f725de
2 changed files with 16 additions and 7 deletions
|
|
@ -15,6 +15,9 @@ import logging
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from django.utils.translation import gettext_lazy as _
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
|
# Set debug mode according to env variable
|
||||||
|
DEBUG = os.getenv("DJANGO_DEBUG", "false").lower() in ("true", "1", "t")
|
||||||
|
|
||||||
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
||||||
BASE_DIR = Path(__file__).resolve().parent.parent
|
BASE_DIR = Path(__file__).resolve().parent.parent
|
||||||
|
|
||||||
|
|
@ -51,13 +54,15 @@ INSTALLED_APPS = [
|
||||||
"crispy_bootstrap5",
|
"crispy_bootstrap5",
|
||||||
# for creating thumbnails, used by email_interface demo views
|
# for creating thumbnails, used by email_interface demo views
|
||||||
'easy_thumbnails',
|
'easy_thumbnails',
|
||||||
# Django debug toolbar
|
|
||||||
'debug_toolbar',
|
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if DEBUG:
|
||||||
|
INSTALLED_APPS += [
|
||||||
|
# Django debug toolbar
|
||||||
|
'debug_toolbar',
|
||||||
|
]
|
||||||
|
|
||||||
MIDDLEWARE = [
|
MIDDLEWARE = [
|
||||||
# Django debug toolbar
|
|
||||||
'debug_toolbar.middleware.DebugToolbarMiddleware',
|
|
||||||
'django.middleware.security.SecurityMiddleware',
|
'django.middleware.security.SecurityMiddleware',
|
||||||
'django.contrib.sessions.middleware.SessionMiddleware',
|
'django.contrib.sessions.middleware.SessionMiddleware',
|
||||||
# enable translation
|
# enable translation
|
||||||
|
|
@ -69,6 +74,12 @@ MIDDLEWARE = [
|
||||||
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if DEBUG:
|
||||||
|
MIDDLEWARE = [
|
||||||
|
# Django debug toolbar
|
||||||
|
'debug_toolbar.middleware.DebugToolbarMiddleware',
|
||||||
|
] + MIDDLEWARE
|
||||||
|
|
||||||
ROOT_URLCONF = 'repapp.urls'
|
ROOT_URLCONF = 'repapp.urls'
|
||||||
|
|
||||||
TEMPLATES = [
|
TEMPLATES = [
|
||||||
|
|
@ -146,9 +157,6 @@ DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
|
||||||
# Repapp configuration
|
# Repapp configuration
|
||||||
######################
|
######################
|
||||||
|
|
||||||
# Set debug mode according to env variable
|
|
||||||
DEBUG = os.getenv("DJANGO_DEBUG", "false").lower() in ("true", "1", "t")
|
|
||||||
|
|
||||||
# basic Python logging configuration
|
# basic Python logging configuration
|
||||||
LOG_LEVEL = "INFO"
|
LOG_LEVEL = "INFO"
|
||||||
if DEBUG:
|
if DEBUG:
|
||||||
|
|
|
||||||
|
|
@ -8,3 +8,4 @@ pylint-django==2.5.3
|
||||||
pylint-plugin-utils==0.7
|
pylint-plugin-utils==0.7
|
||||||
selenium==4.9.0
|
selenium==4.9.0
|
||||||
django-debug-toolbar==4.2.0
|
django-debug-toolbar==4.2.0
|
||||||
|
coverage==7.3.0
|
||||||
|
|
|
||||||
Reference in a new issue