In my django powered app there is only one obvious case where “IntegrityError” can arise.
So, how can I catch that error and display a message using templates?
In my django powered app there is only one obvious case where IntegrityError can
Share
Just use try and catch.
If you want you can use the message in your template.
EDIT
Thanks for Jill-Jênn Vie, you should use
e.__cause__, as described here.