I'm trying to update a project from Django 1.5.5 to Django 1.6 however I've been getting this error everywhere.
Traceback (most recent call last):
File "project/virtualenv/lib/python2.7/site-packages/django/core/handlers/base.py", line 114, in get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "project/virtualenv/lib/python2.7/site-packages/django/contrib/admin/sites.py", line 215, in wrapper
return self.admin_view(view, cacheable)(*args, **kwargs)
File "project/virtualenv/lib/python2.7/site-packages/django/utils/decorators.py", line 99, in _wrapped_view
response = view_func(request, *args, **kwargs)
File "project/virtualenv/lib/python2.7/site-packages/django/views/decorators/cache.py", line 52, in _wrapped_view_func
response = view_func(request, *args, **kwargs)
File "project/virtualenv/lib/python2.7/site-packages/django/contrib/admin/sites.py", line 197, in inner
return self.login(request)
File "project/virtualenv/lib/python2.7/site-packages/django/views/decorators/cache.py", line 52, in _wrapped_view_func
response = view_func(request, *args, **kwargs)
File "project/virtualenv/lib/python2.7/site-packages/django/contrib/admin/sites.py", line 330, in login
return login(request, **defaults)
File "project/virtualenv/lib/python2.7/site-packages/django/views/decorators/debug.py", line 75, in sensitive_post_parameters_wrapper
return view(request, *args, **kwargs)
File "project/virtualenv/lib/python2.7/site-packages/django/utils/decorators.py", line 99, in _wrapped_view
response = view_func(request, *args, **kwargs)
File "project/virtualenv/lib/python2.7/site-packages/django/views/decorators/cache.py", line 52, in _wrapped_view_func
response = view_func(request, *args, **kwargs)
File "project/virtualenv/lib/python2.7/site-packages/django/contrib/auth/views.py", line 43, in login
auth_login(request, form.get_user())
File "project/virtualenv/lib/python2.7/site-packages/django/contrib/auth/__init__.py", line 83, in login
request.session.cycle_key()
File "project/virtualenv/lib/python2.7/site-packages/django/contrib/sessions/backends/base.py", line 277, in cycle_key
self.create()
File "project/virtualenv/lib/python2.7/site-packages/django/contrib/sessions/backends/db.py", line 40, in create
self.save(must_create=True)
File "project/virtualenv/lib/python2.7/site-packages/django/contrib/sessions/backends/db.py", line 62, in save
with transaction.atomic(using=using):
File "project/virtualenv/lib/python2.7/site-packages/django/db/transaction.py", line 244, in __enter__
"Your database backend doesn't behave properly when "
TransactionManagementError: Your database backend doesn't behave properly when autocommit is off. Turn it on before using 'atomic'.
I've removed TransactionMiddleware
from MIDDLEWARE_CLASSES
and replaced it with ATOMIC_REQUESTS = True
. (Same error even if I don't do this step)
Can someone please shed some light on this?
forwards
function, I would do:orm["auth.Group"].objects.get_or_create(name="blah")
. I'll give your suggestion a go when I get the chance.