Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python

Sasan Shadpour
Sasan Shadpour
2,601 Points

Problem with Jinja2 "unknown tag endblock"

Hello

I am getting an error for "TemplateSyntaxError", and it says "Encountered unknown tag 'endblock'."

layout.html:

<!doctype html>
<html>
    <head>
        <title>{% block title %}{% endblock %}</title>
     </head>
     <body>
            { % block content %}{% endblock %}
            <p>Brought to you by the fine folks at Treehouse!</p>
      </body>

</html>

index.html:

{% extends "layout.html" %}

{% block title %}Howy!{% endblock %}

{% block contect %}
<h1>Hello From {{name}}!</h1>
{% endblock %}

1 Answer

Sasan Shadpour
Sasan Shadpour
2,601 Points

I think I found it, there was a space in my layout.html codes before "%". { % block content %} --> {% block content %}

Mark Sebeck
Mark Sebeck
Treehouse Moderator 38,105 Points

Awesome job Sasan finding your error. I marked the answer "Best Answer" for you.