TemplateSyntaxError at /challeges/1
Could not parse the remainder: ‘:’ from ‘1:’
This is my challege.html
{% if month == 1: %}
<h1>This is {{ text }}</h1>
{% else: %}
<p>This is {{ text }}</p>
{% endif %}
This is my views.py
def monthly_challege(request, month):
return render(request, "challeges/challege.html", {
"text": "Your Url Is Empty",
month: month
})
This is my urls.py
urlpatterns = [
path("<month>", views.monthly_challege),
]
>Solution :
You have a typo in your if … else … statement.
It should be
{% if month == 1 %}
<h1>This is {{ text }}</h1>
{% else %}
<p>This is {{ text }}</p>
{% endif %}
as per doc if else doc