I'm quite new to this Django stuff and i'm getting a NoReverseMatch at /cityinfo/
Exception Value:
Reverse for 'user_favorites' with arguments '('',)' and keyword arguments '{}' not found. 1 pattern(s) tried: ['cityinfo/(?P<fav_id>[0-9]+)/$']
basically what i'm trying to do is get all the users Favorited posts and display them when the user clicks on the favorite navigation link in base.html
base.html
<li class="#">
<a href="{% url 'cityinfo:user_favorites' favorites.id %}">
<span class="glyphicon glyphicon-floppy-disk"></span> Favourites
</a>
</li>
urls.py
url(r'^(?P<fav_id>[0-9]+)/$', views.user_favorites, name="user_favorites"),
views.py
def user_favorites(request, fav_id):
if not request.user.is_authenticated():
return render(request, 'cityinfo/login.html')
else:
favorites = get_object_or_404(user_favourite_spot, id=fav_id)
context = {
"favorites": favorites
}
return render(request, 'cityinfo/user_favorites.html', context)
appreciate your help