I am working on my first Django application. I built a template HTML file but cannot get the CSS and JS files to load when viewing on my localhost. I have consulted the Django official documentation but cannot manage to identify the issue. I have cleared the my browser's cache but it did not make a difference.
Settings.py
{% load static %}
(included at the top of the script)
STATIC_ROOT= os.path.join(BASE_DIR, 'static')
STATIC_URL = 'static/'
STATICFILES_DIR = [
os.path.join(BASE_DIR, 'stltaxauctionmap/static')
]
templates/base.html - CSS
<link
href="http://fonts.googleapis.com/css?family=Roboto:300,400,700"
rel="stylesheet"
type="text/css"
/>
<link
href="{% static '/fonts/font-awesome.css' %}"
rel="stylesheet"
type="text/css"
/>
<link
rel="stylesheet"
href="{% static 'bootstrap/css/bootstrap.css' %}"
type="text/css"
/>
<link
rel="stylesheet"
href="{% static 'css/bootstrap-select.min.css' %}"
type="text/css"
/>
<link
rel="stylesheet"
href="{% static 'css/jquery.slider.min.css' %}"
type="text/css"
/>
<link rel="stylesheet" href="{% static 'css/owl.carousel.css' %}" />
<link rel="stylesheet" href="{% static 'css/style.css' %}" />
templates/base.html - JS
<script
type="text/javascript"
src="{% static 'js/jquery-2.1.0.min.js' %}"
></script>
<script
type="text/javascript"
src="http://maps.google.com/maps/api/js?sensor=false"
></script>
<script
type="text/javascript"
src="{% static 'js/jquery-migrate-1.2.1.min.js' %}"
></script>
<script
type="text/javascript"
src="{% static 'bootstrap/js/bootstrap.min.js' %}"
></script>
<script
type="text/javascript"
src="{% static 'js/smoothscroll.js' %}"
></script>
<script
type="text/javascript"
src="{% static 'js/markerwithlabel_packed.js' %}"
></script>
<script type="text/javascript" src="{% static 'js/infobox.js' %}"></script>
<script
type="text/javascript"
src="{% static 'js/owl.carousel.min.js' %}"
></script>
<script
type="text/javascript"
src="{% static 'js/bootstrap-select.min.js' %}"
></script>
<script
type="text/javascript"
src="{% static 'js/jquery.validate.min.js' %}"
></script>
<script
type="text/javascript"
src="{% static 'js/jquery.placeholder.js' %}"
></script>
<script
type="text/javascript"
src="{% static 'js/icheck.min.js' %}"
></script>
<script
type="text/javascript"
src="{% static 'js/jquery.vanillabox-0.1.5.min.js' %}"
></script>
<script
type="text/javascript"
src="{% static 'js/retina-1.1.0.min.js' %}"
></script>
<script
type="text/javascript"
src="{% static 'js/jshashtable-2.1_src.js' %}"
></script>
<script
type="text/javascript"
src="{% static 'js/jquery.numberformatter-1.2.3.js' %}"
></script>
<script type="text/javascript" src="{% static 'js/tmpl.js' %}"></script>
<script
type="text/javascript"
src="{% static 'js/jquery.dependClass-0.1.js' %}"
></script>
<script
type="text/javascript"
src="{% static 'js/draggable-0.1.js' %}"
></script>
<script
type="text/javascript"
src="{% static 'js/jquery.slider.js' %}"
></script>
<script
type="text/javascript"
src="{% static 'js/markerclusterer_packed.js' %}"
></script>
<script
type="text/javascript"
src="{% static 'js/custom-map.js' %}"
></script>
<script type="text/javascript" src="{% static 'js/custom.js' %}"></script>
urls.py
from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('', include('pages.urls')),
path('admin/', admin.site.urls),
]
All URLs report 404:
Folders:
note, I'm working on Windows.