Why was Django able to load a static .png file but not the static .css file?
settings.py
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
TEMPLATE_DIR = os.path.join(BASE_DIR,"templates")
STATIC_DIR = os.path.join(BASE_DIR,"static")
STATIC_URL = '/static/'
STATICFILES_DIRS = [
STATIC_DIR,
]
CSS file
h1{
color: red;
}
HTML
<!DOCTYPE html>
{% load static %}
<html>
<head>
<meta charset="utf-8">
<title>Django Guitar Page</title>
<link rel="stylesheet" href="{% static "css/mysyle.css" %}"/>
</head>
<body>
<<h1>Hi, this is text</h1>
<img src="{% static "images/a_picture.png" %}" alt="Uh oh, didn't show">
</body>
</html>
File Path
first_app/static/css/mystyle.css
first_app/static/css/images/a_picture.png