[Answered ]-How to Insert or update if already exists use Django and SQLITE

1👍

You can use update_or_create.

A convenience method for updating an object with the given kwargs, creating a new one if necessary.

obj, created = User.objects.update_or_create(email='foo@bar.com', name='foo', salary=100)

Refer this https://docs.djangoproject.com/en/3.1/ref/models/querysets/#update-or-create

Leave a comment