Fix static file inclusion

This commit is contained in:
Mark Veidemanis 2022-07-21 13:47:42 +01:00
parent 551401d91a
commit b2707cbbe0
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
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" SECRET_KEY = "insecure-fake-key-do-not-use-in-production"
# SECURITY WARNING: don't run with debug turned on in production! # SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True DEBUG = False
ALLOWED_HOSTS = [] ALLOWED_HOSTS = []
@ -113,9 +113,9 @@ USE_TZ = True
# Static files (CSS, JavaScript, Images) # Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/4.0/howto/static-files/ # 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 # Default primary key field type
# https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field # 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 1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) 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.contrib import admin
from django.urls import include, path from django.urls import include, path
@ -26,4 +28,4 @@ urlpatterns = [
path("accounts/", include("django.contrib.auth.urls")), path("accounts/", include("django.contrib.auth.urls")),
path("accounts/signup/", Signup.as_view(), name="signup"), path("accounts/signup/", Signup.as_view(), name="signup"),
path("ui/drilldown/", Drilldown.as_view(), name="drilldown"), path("ui/drilldown/", Drilldown.as_view(), name="drilldown"),
] ] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)

View File

@ -3,7 +3,7 @@
<html lang="en-GB"> <html lang="en-GB">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">s <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<title>Pathogen - {{ request.path_info }}</title> <title>Pathogen - {{ request.path_info }}</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">