lilspikey / django-background-task

A database-backed work queue for Django
BSD 3-Clause "New" or "Revised" License
107 stars 207 forks source link

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

Open mhsiddiqui opened 9 years ago

mhsiddiqui commented 9 years ago

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 commented 9 years ago

Which version of Django are you using?

I've not yet merged in a pull request to get things working on Django 1.7 (https://github.com/lilspikey/django-background-task/pull/12) which may well fix this.

mhsiddiqui commented 9 years ago

Django 1.8

mhsiddiqui commented 9 years ago

@johnsensible Have you merged pull request?

johnsensible commented 9 years ago

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

ravigadila commented 9 years ago

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

johnsensible commented 9 years ago

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 commented 5 years ago

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