Home > Back-end >  Django App not reading static Javascript from <script>
Django App not reading static Javascript from <script>

Time:10-11

Im fairly new at this and have been all through the previous answers but cant make this work. I am not getting django to read and apply my cart.js file from my base.html template. I have checked and rechecked my settings and files and just cant seem to find it. Can you help?

settings.py enter image description here

base.html

enter image description here

static file structure

enter image description here

main urls.py

enter image description here

Error from template rendering

enter image description here

My best guess is it is somewhere in the static files settings but i just cant seem to understand where.

CodePudding user response:

Above script tag add

{% load static %}

Here's the documentation link of handling static files enter image description here

The issue seems to be in how WhiteNoise is storing and arranging files. Ive tested this through Heroku and everything still seems to be working fine without it although im not sure why.

  • Related