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.
See if specifying the argument changes anything
listing = get_object_or_404(BuyerListing, pk=pk)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With