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 -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -