I am using a button on my Django template, After click on the button it should open a link offering by reverse url( template tags ). I tried with the following code but it didn’t work
<input type= "button" style="float: right;" value="Next Graph" onClick="javascript:location.href = 'reverse(graph_view)';"></input>
I know that some thing is wrong with the above syntax. What will be the right one?
PS: I don’t want to use any external library
Just use the actual template tag for this
{% url %}. See: https://docs.djangoproject.com/en/dev/ref/templates/builtins/#urlUPDATE
It should look like this:
If it still doesn’t work, you have some other problem. Create a new question and make sure post any errors and stacktraces you get.