title: Django Transaction did not work
body: <p>I want to roll back the transaction when the view raise Exception.</p>
  
  <p>I try to follow the step on the <a href="https://docs.djangoproject.com/en/1.8/topics/db/transactions/#autocommit-details" rel="nofollow">Django Doc</a></p>
  
  <p>But it seem that it not work.</p>
  
  <p>Here is my code:</p>
  
  <p><strong>models.py</strong></p>
  
  <pre><code>class Cargo(models.Model):
      serial_number = models.CharField()
      name = models.CharField()
  </code></pre>
  
  <p><strong>views.py</strong></p>
  
  <p>from django.http import JsonResponse
  from .models import Cargo</p>
  
  <pre><code>def test(request):
      cargo = Cargo(serial_number='123456', name='cargo')
      cargo.save()
      raise Exception()
      return JsonResponse({'message': 'ok'})
  </code></pre>
  
  <p>I have turn on my <code>ATOMIC_REQUESTS</code> in my <strong>settings.py</strong>.</p>
  
  <pre><code>DATABASES = {
      'default': {
          'ENGINE': 'django.db.backends.mysql',
          'NAME': 'TABLE',
          'USER': 'USER',
          'PASSWORD': 'PASSWORD',
          'HOST': '127.0.0.1',
          'PORT': '1234',
          'ATOMIC_REQUESTS': True,
      }
  }
  </code></pre>
  
  <p>But every time i visit the <code>test</code> view, it raise the Exception and still add a 'cargo' row in my db.</p>
  
  <p>I want to know how to enable Django Transaction.</p>
  
  <p>Thanks!</p>
  
  <hr>
  
  <p>And one more question, if i use <code>atomic</code> descriped in the <a href="https://docs.djangoproject.com/en/1.8/topics/db/transactions/#controlling-transactions-explicitly" rel="nofollow">Doc</a>,like:</p>
  
  <p><strong>views.py</strong></p>
  
  <pre><code>from django.http import JsonResponse
  from django.db import transaction
  from .models import Cargo
  
  @transaction.atomic
  def test(request):
      cargo = Cargo(serial_number='123456', name='cargo')
      cargo.save()
      raise Exception()
      return JsonResponse({'message': 'ok'})
  </code></pre>
  
  <p>is the <code>'ATOMIC_REQUESTS': True</code> still necessary.</p>