From c5d897cc8029482f32e9feca04795a1abc36bbda Mon Sep 17 00:00:00 2001 From: Bobby Date: Wed, 3 Aug 2022 00:01:30 +0530 Subject: Define rules for static --- thatcomputerscientist/settings.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/thatcomputerscientist/settings.py b/thatcomputerscientist/settings.py index 080535e9..41d12c82 100644 --- a/thatcomputerscientist/settings.py +++ b/thatcomputerscientist/settings.py @@ -74,7 +74,7 @@ ROOT_URLCONF = 'thatcomputerscientist.urls' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', - 'DIRS': [], + 'DIRS': [ str(BASE_DIR / 'templates') ], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ @@ -136,12 +136,16 @@ USE_TZ = True # https://docs.djangoproject.com/en/4.0/howto/static-files/ STATIC_URL = 'static/' +# STATIC_ROOT = BASE_DIR / "staticfiles" +STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles') +STATICFILES_DIRS = [ + os.path.join(BASE_DIR, 'static'), +] # Default primary key field type # https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' -STATIC_ROOT = BASE_DIR / "staticfiles" EMAIL_USE_TLS = True EMAIL_HOST = os.getenv('MAIL_HOST') -- cgit v1.2.3