How to call controller function from template in Django instead of hardcoding URIs?
A:
How to call controller function from template
Not sure what you mean here. If you mean to provide an an HTML link to it see the second part of my answer below.
instead of hardcoding URIs?
In case you haven't already, use the {% url %}
tag. Use this in conjunction with named URLs in your url config.
Manoj Govindan
2010-09-26 14:15:47
A:
If you mean adding URL to the resulting HTML, then either use {% url %} tag as others, or get used to writing and using model_instance.get_absolute_url(). Personally I'm using the latter whenever possible, adding also custom "URL functions" like get_delete_url() etc.
Tomasz Zielinski
2010-09-26 14:46:38