开发者

Django Celery causes an import error on runserver command

When I issue a runserver command, an ImportError is raised from djcelery (Django Celery).

% python manage.py runserver                                                                                                            
~/Workspace/django-projects/no-labels/src
Validating models...
Unhandled exception in thread started by <function inner_run at 0x1ef7320>
Traceback (most recent call last):
  File "/home/damon/Workspace/django-projects/no-labels/env/lib/python2.6/site-packages/django/core/management/commands/runserver.py", line 48, in inner_run
    self.validate(display_num_errors=True)
  File "/home/damon/Workspace/django-projects/no-labels/env/lib/python2.6/site-packages/django/core/management/base.py", line 249, in validate
    num_errors = get_validation_errors(s, app)
  File "/home/damon/Workspace/django-projects/no-labels/env/lib/python2.6/site-packages/django/core/management/validation.py", line 28, in get_validation_errors
    for (app_name, error) in get_app_errors().items():
  File "/home/damon/Workspace/django-projects/no-labels/env/lib/python2.6/site-packages/django/db/models/loading.py", line 146, in get_app_errors
    self._populate()
  File "/home/damon/Workspace/django-projects/no-labels/env/lib/python2.6/site-packages/django/db/models/loading.py", lin开发者_高级运维e 64, in _populate
    self.load_app(app_name)
  File "/home/damon/Workspace/django-projects/no-labels/env/lib/python2.6/site-packages/django/db/models/loading.py", line 78, in load_app
    models = import_module('.models', app_name)
  File "/home/damon/Workspace/django-projects/no-labels/env/lib/python2.6/site-packages/django/utils/importlib.py", line 35, in import_module
    __import__(name)
  File "/home/damon/Workspace/django-projects/no-labels/env/lib/python2.6/site-packages/djcelery/models.py", line 14, in <module>
    from celery.app import default_app
ImportError: No module named app

The same issue occurs when manually trying to import celery.app.default_app in the python console:

>>> from celery.app import default_app
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named app


celery.app was only added on September 14. You'll need to be running a copy of celery released since then.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜