Reputation: 1135
Getting the error in the title when I try to go on my listing_public
page, can't figure out why.
views.py
def listing_public(request, pk):
listing = get_object_or_404(BuyerListing, pk)
return render (
request,
'listing_public.html',
context={'listing':listing}
)
urls.py
url(r'^listing/(?P<pk>\d+)/$', views.listing_public, name='listing_public'),
Template Tags
{% url 'listing_public' pk=listing.pk %}
This is the only other question on Stack Overflow I found regarding this error, but the sole answer didn't solve my problem. Here is the traceback.
Upvotes: 8
Views: 13191
Reputation: 6096
See if specifying the argument changes anything
listing = get_object_or_404(BuyerListing, pk=pk)
Upvotes: 13