Skip to content Skip to sidebar Skip to footer

How To Make Static Style-sheet Working In Django?

By running this code in normal html it runs with style also. But whenever I run it in django it does not run and just show me text. views.py def index(request): return render(r

Solution 1:

static template tag adds STATIC_ROOT to the given URL. So check STATIC_ROOT value in settings.py and change relative paths from

{% static'../static/css/animate.css' %}

to

{% static'css/animate.css' %}

Note, you need this in the beginning of your template to make static work:

{% load static %}

Solution 2:

Instead of :

href="{% static '../static/...

Try with:

href="{% static '../css/...

Also, need to include this: {% load static %} at the beginning of all your templates where you want to use static files.

Post a Comment for "How To Make Static Style-sheet Working In Django?"