DEV Community

Vicente G. Reyes
Vicente G. Reyes

Posted on

1

MultipleObjectsReturned at /rants/first-rant/ get() returned more than one Rant -- it returned 2

I'm getting the error because I have two first-rant slug's on the database. I expected this to come. I have a solution in mind to add random numbers at the end of the url. Can anyone help me implement this using the RandomCharField of https://django-extensions.readthedocs.io/en/latest/field_extensions.html.

Here are my models:

Latest comments (0)

AWS Q Developer image

Your AI Code Assistant

Automate your code reviews. Catch bugs before your coworkers. Fix security issues in your code. Built to handle large projects, Amazon Q Developer works alongside you from idea to production code.

Get started free in your IDE