My settings description.
STATIC_URL = '/static/'
STATICFILES_DIRS = [
os.path.join(BASE_DIR, 'static/css')
]
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
Also, I had added static files to urls.py urlpatterns += staticfiles_urlpatterns()
My HTML template
{% load static %}
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<title>Things I eat</title>
</head>
<body>
<h1> Hello world</h1>
</body>
findstatic
command output:
> python manage.py findstatic styles.css
Found 'styles.css' here:
/project_name/static/css/styles.css
I use django == 3.0.7
I followed advice from similar questions [1,2,3] But my static files are not fetching while rendering. Any advice for debugging?
EDIT: My static dir structure:
static
-- css
---- styles.css