Just add this line to your urls.py:
url(r'^details/$', DetailView.as_view(), name='detail_view'),
or
url(r'^details/(?P<id>\d*)$', DetailView.as_view(), name='detail_view'),
(This is a cleaner solution - thanks to Thomas Orozco)
You need to specify what idis optional in your view function:
def view(request, id=None):
source
share