I'm learning Django. I am trying to load a static css file, but it doesn't work.
That's part of my base.html:
{% load static %}
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- css -->
<link rel="stylesheet" type="text/css" href="{% static 'HomePage/style.css' %}">
</head>
and that's part of my settings.py file:
STATIC_URL = '/static/'
STATICFILES_DIRS = [
BASE_DIR / "static",
'/var/www/static/',
]
STATIC_DIR = os.path.join(BASE_DIR, 'static')
STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'static'),
)
STATIC_ROOT = os.path.join(os.path.dirname(BASE_DIR), "static_in_env", "static_root")
Where did I make mistake ?
I have already used python manage.py collectstatic in command prompt
edit: I see that I declareted STATICFILES_DIRS list two times.