1👍
✅
Use the builtin static
, not static
from staticfiles
:
<head>
{% load static %}
<link rel="stylesheet" type="text/css" href="{% static "css/style.css" %}">
</head>
https://docs.djangoproject.com/en/dev/ref/templates/builtins/#static
Django ships with a
static
template tag. You can use this regardless if you’re usingRequestContext
or not.Note
The
staticfiles
contrib app also ships with astatic
template tag which uses staticfiles’STATICFILES_STORAGE
to build the URL of the given path. Use that instead if you have an advanced use case such as using a cloud service to serve static files…
Source:stackexchange.com