Django: "Import: cannot import name on_commit"

Asked

Viewed 157 times

-1

I’m trying to run an application in Django, however, when using the command python2 manage.py runserver I have the following return:

Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line 385, in execute_from_command_line
    utility.execute()
  File "C:\Python27\lib\site-packages\django\core\management\__init__.py", line 354, in execute
    django.setup()
  File "C:\Python27\lib\site-packages\django\__init__.py", line 21, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "C:\Python27\lib\site-packages\django\apps\registry.py", line 85, in populate
    app_config = AppConfig.create(entry)
  File "C:\Python27\lib\site-packages\django\apps\config.py", line 116, in create
    mod = import_module(mod_path)
  File "C:\Python27\lib\importlib\__init__.py", line 37, in import_module
    __import__(name)
  File "C:\Python27\lib\site-packages\django_cleanup\apps.py", line 9, in <module>
    from . import cache, handlers
  File "C:\Python27\lib\site-packages\django_cleanup\handlers.py", line 10, in <module>
    from django.db.transaction import on_commit
ImportError: cannot import name on_commit

I am using the following versions:

Python 2.7
Django 1.7.1

1 answer

0

Browser other questions tagged

You are not signed in. Login or sign up in order to post.