I am going nuts with muy current Django project and its static files. I tried different solutions on SO
(e.g. Django cannot find my static files and Django Static Files CSS) and even my very own working ones from my other projects..
I just want to link a basic css file located in my projects /static/ folder to my base.html file which will contain the basic navbar for all sites/apps within the project. That's why I decided to place it in the projects directory centrally. Somehow it won't find the file though.
This is my setup where
- debug is set to True (development, no production yet)
settings.py:
STATIC_ROOT = ''
STATIC_URL = '/static/'
STATICFILES_DIRS = (os.path.join('static'), )
base.html:
{% load static %}
[...]
{% block head_css_site %}
<link href="{% static 'base.css' %}" rel="stylesheet" type="text/css">
{% endblock head_css_site %}
[...]
project structure:
error:
GET http://127.0.0.1:8000/static/base.css net::ERR_ABORTED 404 (Not Found)