visc
visc

Reputation: 4959

Loading staticfiles and css files

Is there a way I can use the {% load staticfiles %} to load CSS files in django?

Variations of this don't work and this is obviously wrong:

<css src="{% static "/css/bootstrap/bootstrap.min.css" %}" rel="stylesheet">

Whats the proper way to load css files using this django tag?

EDIT

Here was my actual solution:

<link rel="stylesheet" type="text/css" href="{% static 'css/bootstrap/bootstrap.min.css' %}" />

Upvotes: 2

Views: 42

Answers (1)

catavaran
catavaran

Reputation: 45575

Remove the leading / slash from the {% static %} tag argument:

{% static "css/bootstrap/bootstrap.min.css" %}

Upvotes: 1

Related Questions