Frank Jimenez
Frank Jimenez

Reputation: 369

TemplateSyntaxError: Templates and static files

I have components for the website and they all work fine, for example I have a navbar.html and works flawlessly. However, I think the issue begins when I have a static file. I have another component called 'header.html' (which contains a profile picture) and SHOULD have loaded up a header in my index.html file. But it spits 'TemplateSyntaxError' and says that the issue is with the line code '{% static ... %}'.

enter image description here

My settings.py seems correct (see below). I also included 'django.contrib.staticfiles' and {% load static %} in the main index.html.

enter image description here

This is also the html part:

enter image description here

The structure of my project is as such:

Upvotes: 0

Views: 96

Answers (1)

Lemon.py
Lemon.py

Reputation: 819

Did you load static on the template?

Add {% load static %} to the top of your html file

Upvotes: 1

Related Questions