Same question as this 7 year old one but the solutions don't help plus I'm using django 3 so in my opinion clearly not a duplicate.
I followed exactly the Django documentation about static files.
settings file:
STATIC_URL = '/static/'
DEBUG = True
Folder Structure:
---my_project
------my_project
------app1
------static
---------css
------------mystyle.css
Template:
{% load static %}
<link rel="stylesheet" href="{% static "css/mystle.css" %}">
When browsing to the site I get a 404 Not Found. The link is pointing to the correct directory:
http://127.0.0.1:8000/static/css/mystyle.css
With further search and looking at the documentation (which in my opinion is unclear) I also found the setting STATIC_ROOT
and set it accordingly but that did not help either.
#BASE_DIR = path to project dir
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
What am I doing wrong?