Solution 1 :

if you use version 1. or 2. :

<!DOCTYPE html>
{%load staticfiles %}
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>home</title>
    <link rel="stylesheet" href="{% static 'css/main.css' %}" />
</head>

<body>
<h1>Hello world</h1>
</body>
</html>

////////////////// if you use 3.

<!DOCTYPE html>
{%load static %}
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>home</title>
    <link rel="stylesheet" href="{% static 'css/main.css' %}" />
</head>

<body>
<h1>Hello world</h1>
</body>
</html> 

Problem :

I am having an error “TemplateSyntaxError at /” i can not understand how to solve it.

<!DOCTYPE html>
{%load staticfils%}
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>home</title>
    <link rel="stylesheet" href="{%static'css/main.css'%}" />
</head>

<body>
<h1>Hello world</h1>
</body>
</html>

Comments

Comment posted by Willem Van Onsem

What Django version are you using? The last versions of Djanog use

By

Leave a Reply

Your email address will not be published. Required fields are marked *