Better option to check if a particular instance exists django
An even better approach would be to use .exists() to check if a particular instance exists or not. MyObject.objects.filter(someField=someValue).exists() # return True/False From the .exists() docs: It returns True if the QuerySet contains any results, and False if not. This tries to perform the query in the simplest and fastest way possible, but it does … Read more