0

我已经在https://github.com/viewflow/cookbook克隆了存储库,并正在尝试运行 viewflow_helloworld 教程。

安装要求时,默认设置会安装最新版本的 Django (1.10.5)、Celery 4.0.2 和 Kombu 4.0.2。该应用程序似乎与这些不兼容,并在运行迁移时返回错误

python manage.py migrate
Traceback (most recent call last):
  File "/Users/rodj/PycharmProjects/Django/cookbook/viewflow_helloworld/env/lib/python3.4/site-packages/django/apps/config.py", line 118, in create
    cls = getattr(mod, cls_name)
AttributeError: 'module' object has no attribute 'django'

更改 requirements.txt 文件以下载以下内容

django==1.7
django-viewflow
celery==3.0.24
kombu==2.5.15

一直工作到我尝试登录本地服务器

堆栈跟踪是

python manage.py runserver
Traceback (most recent call last):
  File "/Users/rodj/PycharmProjects/Django/cookbook/viewflow_helloworld/env/lib/python3.4/site-packages/django/conf/__init__.py", line 94, in __init__
    mod = importlib.import_module(self.SETTINGS_MODULE)
  File "/Users/rodj/PycharmProjects/Django/cookbook/viewflow_helloworld/env/lib/python3.4/importlib/__init__.py", line 109, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 2254, in _gcd_import
  File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
  File "<frozen importlib._bootstrap>", line 2212, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 2254, in _gcd_import
  File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
  File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1129, in _exec
  File "<frozen importlib._bootstrap>", line 1471, in exec_module
  File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
  File "/Users/rodj/PycharmProjects/Django/cookbook/viewflow_helloworld/config/__init__.py", line 3, in <module>
    from .celery_app import app as celery_app  # NOQA
  File "/Users/rodj/PycharmProjects/Django/cookbook/viewflow_helloworld/config/celery_app.py", line 4, in <module>
    from celery import Celery
ImportError: cannot import name 'Celery'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/Users/rodj/PycharmProjects/Django/cookbook/viewflow_helloworld/env/lib/python3.4/site-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
    utility.execute()
  File "/Users/rodj/PycharmProjects/Django/cookbook/viewflow_helloworld/env/lib/python3.4/site-packages/django/core/management/__init__.py", line 345, in execute
    settings.INSTALLED_APPS
  File "/Users/rodj/PycharmProjects/Django/cookbook/viewflow_helloworld/env/lib/python3.4/site-packages/django/conf/__init__.py", line 46, in __getattr__
    self._setup(name)
  File "/Users/rodj/PycharmProjects/Django/cookbook/viewflow_helloworld/env/lib/python3.4/site-packages/django/conf/__init__.py", line 42, in _setup
    self._wrapped = Settings(settings_module)
  File "/Users/rodj/PycharmProjects/Django/cookbook/viewflow_helloworld/env/lib/python3.4/site-packages/django/conf/__init__.py", line 98, in __init__
    % (self.SETTINGS_MODULE, e)
ImportError: Could not import settings 'config.settings' (Is it on sys.path? Is there an import error in the settings file?): cannot import name 'Celery'

使用这些设置似乎无法再连接到 Celery。

任何人都可以请告知他们是否已设法使这项工作正常进行,如果可以,则需要什么库和版本的组合?

4

1 回答 1

0

如自述文件中所述,django-viewflow 不支持 django 1.7

您还尝试使用过时的 kombu 版本运行演示。

这是 viewflow 0.10 支持的最新版本要求

django==1.10.5 django-viewflow==0.10.0 django-filter==0.15.3 celery==3.1.23 kombu==3.0.37

您可以使用 celery 4.x,但在这种情况下,您需要更新演示 settings.py 并使用不同的代理,celery 4.x 放弃了 django:// 代理支持。

于 2017-01-09T11:05:45.387 回答