0

When i include the js file in base.html <script src="static/assets/js/functions.js"></script> the CSS stops working entirely but when i remove the JS file or comment it out the CSS start loading and rendering well. I even tried putting the whole js code manually into the base.html but it still doesnt work i dont really know what to do right now.

The JS and CSS Files are located in a static folder in root directly and i'm sure there is not typo or anything not well arranged

10
  • 3
    Why not use the {% static %} tag to generate the correct path, like you do for all your other JS and CSS? Commented Dec 29, 2021 at 12:45
  • @IainShelvington please where should i use the {% static %}? in my base.html?? i get this error when i use it in base.html top TemplateSyntaxError at / 'static' takes at least one argument (path to file) Commented Dec 29, 2021 at 12:59
  • Copy how you used the tag for every other JS file: <script src="{% static 'assets/js/functions.js' %}"></script> Commented Dec 29, 2021 at 13:06
  • @IainShelvington i did it already in my base.html but it still doesn't work, i appreciate your time Commented Dec 29, 2021 at 13:13
  • 1
    Don't know if it's just for showcasing, but I can't see the <body> tag anywhere!? Commented Dec 29, 2021 at 13:19

1 Answer 1

0

I don't exactly know what the issue was but when i added <base href="{% static '/' %}"> it started working just fine

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.