2

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' %}" />

1 Answer 1

1

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

{% static "css/bootstrap/bootstrap.min.css" %}
Sign up to request clarification or add additional context in comments.

3 Comments

Thanks a ton, saved me quite a bit of time friend!
@JeffreyHaines You should accept the answer if it helped; please do not edit your original question.
Um selcuk, I edited with helpful information. Please don't edit MY question

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.