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

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -