Pregatire pentru productie si adaugare whitenoise

This commit is contained in:
2026-09-07 14:44:20 +03:00
parent 3649b0126d
commit 13b86106ce
8 changed files with 142 additions and 25 deletions
+4 -5
View File
@@ -24,9 +24,9 @@ BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = "django-insecure-z(p$%wh6x^_9!1cgt%!s$w8k39(fox-^!iujxai42_wncja4%s"
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
DEBUG = False
ALLOWED_HOSTS = ["localhost", "127.0.0.1", "0.0.0.0"]
ALLOWED_HOSTS = ["192.168.100.142", "eumi.local", "localhost", "127.0.0.1", "0.0.0.0"]
# Application definition
@@ -48,6 +48,7 @@ INSTALLED_APPS = [
MIDDLEWARE = [
"django.middleware.security.SecurityMiddleware",
"whitenoise.middleware.WhiteNoiseMiddleware",
"django.contrib.sessions.middleware.SessionMiddleware",
"django.middleware.common.CommonMiddleware",
"django.middleware.csrf.CsrfViewMiddleware",
@@ -128,9 +129,7 @@ USE_TZ = True
# https://docs.djangoproject.com/en/6.1/howto/static-files/
STATIC_URL = "static/"
STATICFILES_DIRS = [
BASE_DIR / "static",
]
STATIC_ROOT = BASE_DIR / "staticfiles"
# Email