[Answered ]-Getting a TypeError while trying to make a unique page in Django

1👍

you need to add photo_collection to your view parameters.

it will be like this:

def photo_collection(request, photo_collection):
  image = Image.objects.all()
  return render (request, 'photo_app/collection.html', context={'image': image})

when ever you add a variable to your url path you need to add that variable to view parameters too.

here is the documentation for this matter:
https://docs.djangoproject.com/en/4.1/topics/http/urls/

👤hiwa

Leave a comment