[Answer]-Django STATIC_FILE doesn't work as i thought?

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 using RequestContext or not.

Note

The staticfiles contrib app also ships with a static 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…

Leave a comment