try:
if MyModel.objects.filter(
name = active_sheet["{}{}".format("A", row)].value,
).exists():
# add data to list
else:
# save the new user into the user model
MyModel.objects.create(
name = active_sheet["{}{}".format("A", row)].value,
)
except Exception as e:
messages.warning(request, '%s. If you are seing this, there is an error in your file.' % e)