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 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'.
|
||||
BASE_DIR = Path(__file__).resolve().parent.parent
|
||||
|
||||
|
|
@ -51,13 +54,15 @@ INSTALLED_APPS = [
|
|||
"crispy_bootstrap5",
|
||||
# for creating thumbnails, used by email_interface demo views
|
||||
'easy_thumbnails',
|
||||
]
|
||||
|
||||
if DEBUG:
|
||||
INSTALLED_APPS += [
|
||||
# Django debug toolbar
|
||||
'debug_toolbar',
|
||||
]
|
||||
|
||||
MIDDLEWARE = [
|
||||
# Django debug toolbar
|
||||
'debug_toolbar.middleware.DebugToolbarMiddleware',
|
||||
'django.middleware.security.SecurityMiddleware',
|
||||
'django.contrib.sessions.middleware.SessionMiddleware',
|
||||
# enable translation
|
||||
|
|
@ -69,6 +74,12 @@ MIDDLEWARE = [
|
|||
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
||||
]
|
||||
|
||||
if DEBUG:
|
||||
MIDDLEWARE = [
|
||||
# Django debug toolbar
|
||||
'debug_toolbar.middleware.DebugToolbarMiddleware',
|
||||
] + MIDDLEWARE
|
||||
|
||||
ROOT_URLCONF = 'repapp.urls'
|
||||
|
||||
TEMPLATES = [
|
||||
|
|
@ -146,9 +157,6 @@ DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
|
|||
# Repapp configuration
|
||||
######################
|
||||
|
||||
# Set debug mode according to env variable
|
||||
DEBUG = os.getenv("DJANGO_DEBUG", "false").lower() in ("true", "1", "t")
|
||||
|
||||
# basic Python logging configuration
|
||||
LOG_LEVEL = "INFO"
|
||||
if DEBUG:
|
||||
|
|
|
|||
|
|
@ -8,3 +8,4 @@ pylint-django==2.5.3
|
|||
pylint-plugin-utils==0.7
|
||||
selenium==4.9.0
|
||||
django-debug-toolbar==4.2.0
|
||||
coverage==7.3.0
|
||||
|
|
|
|||
Reference in a new issue