I have a url defined as follows:
url(r'^details/(?P<id>\d+)$', DetailView.as_view(), name='detail_view'),
In my templates, I want to be able to get the following url: /details/ from the defined url.
I tried {% url detail_view %}, but I get an error since I am not specifying the id parameter.
I need the url without the ID because I will be appending it using JS.
How can I accomplish this?
idparameter, so why would you want to create a link to it? Maybe you're trying to solve another problem and your solution just isn't the right one?id = -1(which you wouldn't expect to be an ID anyway) and replace the rightmost -1 with the proper ID when you need it. Seems very hackish to me if you ask me, but always better than defining another URL.