django - How can I check if a specific URL reserve match will work? -
i have {% url form_entry %}
tag in template, while form_entry
value comes database.
if url can't resolved, i'm getting noreversematch
. how can check if tag succeed before running , getting exception?
something like:
{% if resolvable form_entry %} <a href="{% url form_entry %}">click here</a> {% else %} sorry, not found. {% endif %}
use as
option of url
tag.
{% url form_entry the_url %} {% if the_url %} <a href="{{ the_url }}">click here</a> {% else %} sorry, not found. {% endif %}
Comments
Post a Comment