我已经在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。
任何人都可以建议他们是否设法使其正常工作,如果是,那么需要哪些库和版本的组合?
答案 0 :(得分: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,但在这种情况下,您需要更新demo settings.py并使用不同的代理,celery 4.x删除django://代理支持。