Skip to content
Advertisement

Django – issue with loading css

I’ve recently started learning Django and I’ve been having a lot of issues with implementing css into my code. I’ve found a lot of people with the same issue as me but I am still unable to find an answer.

Currently when I run open the website it give me this https://imgur.com/a/0N23s7b

And I’m not sure if this is because of the settings, the actual css or something in the html.

My html boilerplate

JavaScript

settings.py

JavaScript

views.py

JavaScript

urls.py

JavaScript

Advertisement

Answer

You need to add a space between the name of the template tag and its parameters, so it should be:

JavaScript

The parser of the Django template engine has some peculiarities. For example, a tag should not be spanned over multiple lines, and like in Python’s method calls one should first list the positional parameters and then the named parameters.

Advertisement