Issue
In Django/Python, how do I catch a specific mySQL error: 'IntegrityError':
try:
cursor.execute(sql)
except IntegrityError:
do_something
Not sure what I should import and from where.
Solution
DId you try from django.db import IntegrityError
?
Answered By - Torsten Engelbrecht
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.