Unclosed tag on line 6: 'with'. Looking for one of: endwith

Question:

I’m learning how to use Django Templates but im getting this error

Unclosed tag on line 6: 'with'. Looking for one of: endwith.

this is my html code

<!DOCTYPE html>
<html>
  <body>
    <h1>Favorite rapper:</h1>

    {% with person="2pac" %}

    <h1>{{person}}</h1>
  </body>
</html>

this is the tutorial that I’m doing

Asked By: Martin Arreola

||

Answers:

The error makes complete sense you should close the with tag so:

<!DOCTYPE html>
<html>
  <body>
    <h1>Favorite rapper:</h1>

    {% with person="2pac" %}

    <h1>{{person}}</h1>
    {% endwith %}
  </body>
</html>
Answered By: Sunderam Dubey
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.