title: Django / Python: catch MySQL IntegrityError
body: <p>In Django/Python, how do I catch a specific mySQL error: 'IntegrityError':</p>
  
  <pre><code>try:
     cursor.execute(sql)
  except IntegrityError:
      do_something
  </code></pre>
  
  <p>Not sure what I should import and from where.</p>