title: Cant handle model IntegrityError in django
body: <p>I have model that contains <code>name</code> field with <code>unique = True</code> like below</p>
  <pre class="lang-py prettyprint-override"><code>class MyModel(models.Model):
      name = models.CharField(max_length=100 , unique= True)
  </code></pre>
  <p>When I try to submit duplicate data in my model it raise <code>IntegrityError</code> as expected but I can't handleit in except block in my view.</p>
  <pre class="lang-py prettyprint-override"><code>from django.db import IntegrityError
  try :
      name = MyModel(name= my_new_name)
  except IntegrityError:
      return HttpResponse('Error') # this code never execute
  </code></pre>
  <p>My error:</p>
  <pre><code>django.db.utils.IntegrityError: UNIQUE constraint failed
  </code></pre>