I have an "NoReverseMatch at ∕ "
eception with exception value:
Reverse for 'listEvents' with keyword arguments '{'values': ''}' not found. 1 pattern(s) tried: ['events/events\\/(?P<values>[^/]+)\\/$']
The odd thing is that I do not recognize this part: events/events\\/(?P<values>[^/]+)\\/$
My JScode:
var categories ="{% url 'events:listEvents' values=string %}";
where string
is a SQL query.
This is my URL
path('events/<str:values>/', views.showRequestedEvents, name='listEvents')
And this is my view
def showRequestedEvents(request, values):
events = serialize('geojson', Event.objects.raw(values))
return HttpResponse(events, content_type='json')
I know that it is pretty basic and I have seen similar questions has been asked a lot, yet even after searching for about 2 hr I haven't figured it out, so help!
Please...
{'values': ''}
is telling you thatvalues
is not set in the template context. ``NoReverseMatch at /` is telling you that it's the index view for/
that is causing the problem.urls.py
and the full stacktrace of the error, and also which URL you are trying to access