加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > Python > 正文

使用Django的manage.py命令运行Celery时,它返回一个奇怪的错误

发布时间:2020-12-20 13:21:26 所属栏目:Python 来源:网络整理
导读:当我运行以下命令时,它会产生以下错误: % python manage.py celeryd -l INFO ~/Workspace/django-projects/project/srcTraceback (most recent call last): File "manage.py",line 11,in module execute_manager(settings) File "/home/damon/Workspace/dja
当我运行以下命令时,它会产生以下错误:

% python manage.py celeryd -l INFO                                                                                                     ~/Workspace/django-projects/project/src
Traceback (most recent call last):
  File "manage.py",line 11,in <module>
    execute_manager(settings)
  File "/home/damon/Workspace/django-projects/project/env/lib/python2.6/site-packages/django/core/management/__init__.py",line 438,in execute_manager
    utility.execute()
  File "/home/damon/Workspace/django-projects/project/env/lib/python2.6/site-packages/django/core/management/__init__.py",line 379,in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/damon/Workspace/django-projects/project/env/lib/python2.6/site-packages/django/core/management/__init__.py",line 261,in fetch_command
    klass = load_command_class(app_name,subcommand)
  File "/home/damon/Workspace/django-projects/project/env/lib/python2.6/site-packages/django/core/management/__init__.py",line 67,in load_command_class
    module = import_module('%s.management.commands.%s' % (app_name,name))
  File "/home/damon/Workspace/django-projects/project/env/lib/python2.6/site-packages/django/utils/importlib.py",line 35,in import_module
    __import__(name)
  File "/home/damon/Workspace/django-projects/project/env/lib/python2.6/site-packages/djcelery/management/commands/celeryd.py",line 13,in <module>
    class Command(CeleryCommand):
  File "/home/damon/Workspace/django-projects/project/env/lib/python2.6/site-packages/djcelery/management/commands/celeryd.py",line 17,in Command
    option_list = CeleryCommand.option_list + worker.get_options()
  File "/home/damon/Workspace/django-projects/project/env/lib/python2.6/site-packages/celery/bin/celeryd.py",line 89,in get_options
    conf = self.app.conf
AttributeError: 'NoneType' object has no attribute 'conf'

这是版本信息:

% python                                                                                                                               ~/Workspace/django-projects/project/src
Python 2.6.5 (r265:79063,Apr 16 2010,13:57:41) 
[GCC 4.4.3] on linux2
Type "help","copyright","credits" or "license" for more information.
>>> import celery
>>> print celery.VERSION
(2,2,'a1')
>>> import djcelery
>>> print djcelery.VERSION
(2,'a1')

解决方法

应该很容易修复:只需升级你的django-celery安装.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读