Fix static file inclusion

This commit is contained in:
2022-07-21 13:47:42 +01:00
parent 551401d91a
commit b2707cbbe0
3 changed files with 7 additions and 5 deletions

View File

@@ -23,7 +23,7 @@ BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = "insecure-fake-key-do-not-use-in-production"
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
DEBUG = False
ALLOWED_HOSTS = []
@@ -113,9 +113,9 @@ USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/4.0/howto/static-files/
STATIC_URL = "core/static/"
STATIC_URL = "static/"
STATICFILES_DIRS = (os.path.join(BASE_DIR, STATIC_URL),)
STATICFILES_DIRS = (os.path.join(BASE_DIR, "core/static/"),)
# Default primary key field type
# https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field

View File

@@ -13,6 +13,8 @@ Including another URLconf
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import include, path
@@ -26,4 +28,4 @@ urlpatterns = [
path("accounts/", include("django.contrib.auth.urls")),
path("accounts/signup/", Signup.as_view(), name="signup"),
path("ui/drilldown/", Drilldown.as_view(), name="drilldown"),
]
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)