load static and DOCTYPE html position in django views

Viewed 221

I am new to Django and have trouble understanding the difference between the position of lines shown below:

{% load static %}
<!DOCTYPE html>

In the above code, the PyCharm shows error but if I change the position as shown below, it works as intended:

<!DOCTYPE html>
{% load static %}

Can anyone explain how this works or if I am doing it the wrong way? Thanks!!

1 Answers

You need to add an extension named "Django templates" in your vs-code or any other editor you are using. [check the correct name of Extension and author After This: Your Code will look like this with No warning:- Image after installing extension

Related