I'm currently training in the Django framework and am attaching a CSS document to an HTML document.
All pretty straight forward staff.
Except it apparently isn't. Hardly surprising really.
Can anyone clear this up for me as to why my server not seeing the static CSS file despite correctly pointing Django in the correct directory?
In the settings I have the following config:
STATIC_URL = 'static/'
STATICFILES_DIRS = [
BASE_DIR / 'static',
BASE_DIR / '<APP NAME>/static',
]
At the top of the HTML document, I have the following setup. The {% block header %}
is in the <header>
tag of the base.html
document.
{% extends 'base.html' %}
{% load static %}
{% block header %}
<link rel="stylesheet" href="{% static 'main.css' %}">
{% endblock %}
The static
folder is located in ROOT / <APP NAME>
/ static
/ main.css
So how come the server is not picking up the static
folder when it really should be?
Many thanks.