title: Django ignores transactions
body: <p>I am trying to use transaction in Django. It seems that django ignores it. If there is an exception in the block, I expect that the transaction will be rolled back and the DB won't be changed. However, the DB is changed when I query it later.</p>
  
  <p>All my tables are InnoDB. Transactions in mysql-shell work perfectly.</p>
  
  <p>python 2.7.5+, mysql 5.5.54, django 1.8.7.</p>
  
  <p>This is my test code:</p>
  
  <p>Django settings:</p>
  
  <pre><code>DATABASES = {
      'my_app': {
          'ENGINE': 'django.db.backends.mysql',
          'NAME': 'my_db',
          'USER': ROOT_USER,
          'PASSWORD': ROOT_PASS,
          'HOST': ROOT_HOST,
          'PORT': '3306',
      }
  }
  </code></pre>
  
  <p>code:</p>
  
  <pre><code>import django
  import os
  
  from django.db import transaction
  
  from my_app.models import Account
  
  os.environ.setdefault("DJANGO_SETTINGS_MODULE", "my_proj.settings")
  django.setup()
  
  with transaction.atomic():
      Account.objects.create(account_name='newacc')
      raise Exception('no!!!!')
  </code></pre>
  
  <p>The expected result is that this object will not be in DB after execution.
  The real result is that the account is created in DB, although there was an exception.</p>
  
  <p>Even more than that: when debugging the code, when breaking at the 'raise' line, I can see the new object in DB already (using workbench).</p>