[dev] install django-extensions for shell_plus and show_urls

This commit is contained in:
bronsen 2025-03-12 21:39:43 +01:00
parent 92e38ffb37
commit 8cc5d405b4
3 changed files with 32 additions and 4 deletions

View file

@ -12,19 +12,23 @@ import environ
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
env = environ.Env(DEBUG=(bool, False))
env = environ.Env(
DEBUG=(bool, False),
DEV=(bool, False),
)
environ.Env.read_env(BASE_DIR / ".env")
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/5.1/howto/deployment/checklist/
SECRET_KEY = env("SECRET_KEY")
DEBUG = env("DEBUG")
ALLOWED_HOSTS = []
SESSION_COOKIE_SECURE = True
CSRF_COOKIE_SECURE = True
# Application definition
INSTALLED_APPS = [
"django.contrib.admin",
"django.contrib.auth",
@ -33,6 +37,11 @@ INSTALLED_APPS = [
"django.contrib.messages",
"django.contrib.staticfiles",
]
if env("DEV") is True:
INSTALLED_APPS.extend([
"django_extensions",
])
SHELL_PLUS = "ipython"
MIDDLEWARE = [
"django.middleware.security.SecurityMiddleware",