SyntaxFix
Write A Post
Hire A Developer
Questions
Django has support for this, check get_or_create
person, created = Person.objects.get_or_create(name='abc') if created: # A new person object created else: # person object already exists