3π
in your case get() method return more than one Category
here:
category = Category.objects.get(slug=category_name_slug) # error
Django will complain if more than one item matches the get()
query. In this case, it will raise MultipleObjectsReturned
.
Check in your database why you have three categories
with same slug
and remove them or change slugs
π€Druta Ruslan
Source:stackexchange.com