Openshift不会在push上执行syncdb

时间:2014-08-11 23:09:35

标签: python django openshift

执行推送和app-restart时出现以下错误:

remote: Executing 'python /var/lib/openshift/6783687678687678/app-root/runtime/repo//wsgi/openshift/manage.py syncdb --noinput' 

remote: python: can't open file '/var/lib/openshift/6783687678687678/app-root/runtime/repo/wsgi/openshift/manage.py': [Errno 2] No such file or directory

然而,这不是我的应用程序的路径。我无法找到设置的位置,以便我可以将它们更改为实际路径。我尝试过:setup.py, settings, application并且这些似乎与上述路径无关。路径应该是:

/var/lib/openshift/6783687678687678/app-root/runtime/repo/wsgi/mycoolapp/manage.py'

如果我更改了action_hooks中的路径,即部署,我会得到以下内容:

Executing 'python /var/lib/openshift/6783687678687678/app-root/runtime/repo//wsgi/app/manage.py collectstatic --noinput'
remote: Traceback (most recent call last):
remote:   File "/var/lib/app/6783687678687678/app-root/runtime/repo/wsgi/app/manage.py", line 2, in <module>
remote:     from django.core.management import execute_manager
remote: ImportError: cannot import name execute_manager

1 个答案:

答案 0 :(得分:1)

来自cartridge docs

  

为了向后兼容,选择wsgi / application路径作为默认WSGI入口点&gt;优先级更高。您可以使用OPENSHIFT_PYTHON_WSGI_APPLICATION&gt;自定义路径。环境变量。

但看起来您的应用程序位于正确的路径中,因此我会在~/.openshift/action_hooks/下的仓库中检查您的action_hooks,看看是否定义了一些自定义操作。