\nMy code for this template - (login.html) - is below:
\n{% extends "learning_logs/base.html" %}\n\n{% block content %}\n\n {% if form.errors %}\n <p>Your username and password didn't match. Please try again.'</p>\n {% endif %}\n\n <form method="post" action="{% url 'users:login' %}">\n {% csrf_token %}\n {{ form.as_p }}\n\n <button name="sumbit">log in</button>\n <input type="hidden" name="next" value="{% extends 'learning_logs/index.html' %}" />\n </form>\n\n{% endblock content %} \n \n
\nI am very confused, and I am wondering whether anyone knows what the problem is?\nThanks
\nMilo
<input type=\"hidden\" name=\"next\" value=\"{% extends 'learning_logs/index.html' %}\" />\n
\n\nAbove line contains {% extends .... %}
. To prevent being interpreted as a extends
tag, use templatetag
tag:
<input type=\"hidden\" name=\"next\" value=\"{% templatetag openblock %} extends 'learning_logs/index.html' {% templatetag closeblock %}\" />\n
\n","author":{"@type":"Person","name":"falsetru"},"upvoteCount":2}}}Reputation: 365
I am receiving an error message when I go to one of my pages in my Django project, as it is saying that the End-block tag is invalid (asks whether I remembered to register or load). The error looks like this:
My code for this template - (login.html) - is below:
{% extends "learning_logs/base.html" %}
{% block content %}
{% if form.errors %}
<p>Your username and password didn't match. Please try again.'</p>
{% endif %}
<form method="post" action="{% url 'users:login' %}">
{% csrf_token %}
{{ form.as_p }}
<button name="sumbit">log in</button>
<input type="hidden" name="next" value="{% extends 'learning_logs/index.html' %}" />
</form>
{% endblock content %}
I am very confused, and I am wondering whether anyone knows what the problem is?
Thanks
Milo
Upvotes: 1
Views: 1145
Reputation: 111
for me it was wrongly auto-formatted html file. Check auto-formatting for html files.
Upvotes: 0
Reputation: 369444
<input type="hidden" name="next" value="{% extends 'learning_logs/index.html' %}" />
Above line contains {% extends .... %}
. To prevent being interpreted as a extends
tag, use templatetag
tag:
<input type="hidden" name="next" value="{% templatetag openblock %} extends 'learning_logs/index.html' {% templatetag closeblock %}" />
Upvotes: 2