2011-10-11 248 views
2

我一直在关注heroku django教程http://devcenter.heroku.com/articles/django,我一直在遇到以下问题。 当我运行heroku open并去我的应用程序的网站,我总是得到一个Application Error。当我看我的日志看下面几行:在Heroku上部署Django应用程序

2011-10-11T04:55:35+00:00 heroku[web.1]: Starting process with command `python hellodjango/manage.py runserver` 
2011-10-11T04:55:35+00:00 app[web.1]: python: can't open file 'hellodjango/manage.py': [Errno 2] No such file or directory 

ProcFile只包含web: python hellodjango/manage.py runserver

最后,当我在命令行使用foreman start时,我的django应用程序在本地运行正常。

任何想法?谢谢

回答

1

您的hellodjango目录已添加,承诺git,并推到Heroku?您应该能够确保这一具有:

git status 

另外,你可以探索具有所有的应用程序代码和配置VAR提供一个孤立的DYNO实例:

heroku run bash 

这应该让你确保文件在那里,如果您能够在Procfile中运行相同的命令,您应该看到相同的结果以帮助进行故障排除。

+0

最终,我通过将ProcFile更改为“worker:python hellodjango/manage.py runserver”来实现它。我想我并不清楚Web下的内容以及ProcFile中的工作内容。 – randomletters

+0

@randomletters不要做“worker:python hellodjango/manage.py runserver”你正在做的是从开发服务器运行项目。这会在运行一段时间后导致主要的缓存堆积。更何况,它可能会在生产几个小时后崩溃。让Heroku为你处理部署!按照CraigKerstiens的建议,尝试使用Fabric来推送/部署代码库和“heroku run”。 – Mykel