Mobile app version of vmapp.org
Login or Join
Welton855

: Why django is not accepting spaces in template? {% %} means that this is a django template delimiter. So inside {% %} the space should not matter I guess. Now in the example: <a href="{%

@Welton855

Posted in: #Django

{% %} means that this is a django template delimiter. So inside {% %} the space should not matter I guess.
Now in the example:

<a href="{% url 'post_detail' pk=post.pk %}">{{ post.title }}</a>

This is showing expected output whereas

<a href="{% url 'post_detail' pk = post.pk %}">{{ post.title }}</a>

is showing error.
Why this is sensitive to whitespace?

10% popularity Vote Up Vote Down


Login to follow query

More posts by @Welton855

0 Comments

Sorted by latest first Latest Oldest Best

Back to top | Use Dark Theme