[Django]-Tango With Django – Django 2.0

3πŸ‘

in your case get() method return more than one Category here:

category = Category.objects.get(slug=category_name_slug) # error

from docs :

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

Leave a comment