From f2f2fadae4d4de6ebf83740f3e49bec55cd56017 Mon Sep 17 00:00:00 2001 From: realaravinth Date: Thu, 7 Jul 2022 13:59:06 +0530 Subject: [PATCH] feat: use whitenoise for static file in development too for uniform Behavior MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit > it opens up the possibility for differences in behaviour between development and production environments. For this reason it’s a good idea to use WhiteNoise in development as well. source: http://whitenoise.evans.io/en/stable/django.html#using-whitenoise-in-development --- dashboard/settings.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dashboard/settings.py b/dashboard/settings.py index 18716c1..d2e6361 100644 --- a/dashboard/settings.py +++ b/dashboard/settings.py @@ -24,13 +24,13 @@ SECRET_KEY = "django-insecure-44zt@)$td7_yh(01q^hrce%h(311n!djn%%#s1b7$cvfy!pf7y # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True - ALLOWED_HOSTS = [] # Application definition INSTALLED_APPS = [ + "whitenoise.runserver_nostatic", "django.contrib.admin", "django.contrib.auth", "django.contrib.contenttypes", @@ -131,9 +131,9 @@ USE_TZ = True STATIC_URL = "static/" STATIC_ROOT = BASE_DIR / "static" -# STATICFILES_DIRS = [ -# BASE_DIR / "static", -# ] +STATICFILES_DIRS = [ + BASE_DIR / "common-static", +] STATICFILES_STORAGE = "whitenoise.storage.CompressedManifestStaticFilesStorage"