Skip to content
This repository has been archived by the owner on Feb 27, 2021. It is now read-only.

AttributeError: 'module' object has no attribute 'autocommit' #15

Open
mhsiddiqui opened this issue Jul 27, 2015 · 7 comments
Open

AttributeError: 'module' object has no attribute 'autocommit' #15

mhsiddiqui opened this issue Jul 27, 2015 · 7 comments

Comments

@mhsiddiqui
Copy link

When running 'python manage.py' after adding background-task in installed apps, I am getting following error 'AttributeError: 'module' object has no attribute 'autocommit'.
Full output is as follow.


Traceback (most recent call last):
File "manage.py", line 9, in
execute_from_command_line(sys.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/init.py", line 338, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python2.7/dist-packages/django/core/management/init.py", line 312, in execute
django.setup()
File "/usr/local/lib/python2.7/dist-packages/django/init.py", line 18, in setup
apps.populate(settings.INSTALLED_APPS)
File "/usr/local/lib/python2.7/dist-packages/django/apps/registry.py", line 108, in populate
app_config.import_models(all_models)
File "/usr/local/lib/python2.7/dist-packages/django/apps/config.py", line 198, in import_models
self.models_module = import_module(models_module_name)
File "/usr/lib/python2.7/importlib/init.py", line 37, in import_module
import(name)
File "/home/mhassan/second-vagrant-env/dev-platform/code/worksteps/testing/models.py", line 1148, in
@background(schedule=5)
File "/usr/local/lib/python2.7/dist-packages/background_task/init.py", line 5, in background
from tasks import tasks
File "/usr/local/lib/python2.7/dist-packages/background_task/tasks.py", line 115, in
class DBTaskRunner(object):
File "/usr/local/lib/python2.7/dist-packages/background_task/tasks.py", line 145, in DBTaskRunner
@transaction.autocommit

AttributeError: 'module' object has no attribute 'autocommit'

@johnsensible
Copy link
Contributor

Which version of Django are you using?

I've not yet merged in a pull request to get things working on Django 1.7 (#12) which may well fix this.

@mhsiddiqui
Copy link
Author

Django 1.8

@mhsiddiqui
Copy link
Author

@johnsensible
Have you merged pull request?

@johnsensible
Copy link
Contributor

Sorry no. Very busy at the moment. Will try to get it sorted soon though.

@ravigadila
Copy link

Hello, @johnsensible
Is this issue solved or not..!

@johnsensible
Copy link
Contributor

It should be working if you use the code from that pull request. However I've not had time to review that pull request and merge it in properly (mostly as I've not had any projects using Django 1.7 and django background task).

@IRIP
Copy link

IRIP commented Mar 1, 2019

та же проблема на django2 !

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants