Is it possible to check in template that some url match any pattern from urls?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This is something you’d normally want to do in a views.py file with the reverse() helper for named URLs with known args or resolve() for paths.
If you do need this functionality in a template specifically, here is a hacky solution:
Note: this doesn’t guarantee that the URL is valid, just that there was a pattern match.