S
S
sortfact3332021-03-01 13:53:14
Django
sortfact333, 2021-03-01 13:53:14

Why is static_url not working?

In settings.py I have either
STATIC_URL = '/static/'

STATIC_HOST = os.environ.get('DJANGO_STATIC_HOST', '')
STATIC_URL = STATIC_HOST + '/static/'

And in html
{% load static %}
<link href="{% static "d.css" %}" rel="stylesheet" type="text/css" media="screen" />

But I am getting an error
127.0.0.1/:12 GET http://127.0.0.1:8000/static/d.css net::ERR_ABORTED 404 (Not Found)

What have I done wrong?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question