我尝试使用本教程将我的应用部署到Heroku:
https://devcenter.heroku.com/articles/getting-started-with-django#deploy-to-heroku
我设法将我的应用程序推送到Heroku,但是当我尝试确保至少有一个dyno运行时,我一直收到此错误:
(tapeworm_django)Christophers-MacBook-Pro-2:tapeworm christopherspears$ heroku ps:scale web=1
Scaling dynos... failed
! No app specified.
! Run this command from an app folder or specify which app to use with --app APP.
(tapeworm_django)Christophers-MacBook-Pro-2:tapeworm christopherspears$ heroku ps:scale web=1 --app tapeworm
Scaling dynos... failed
! Resource not found
我在与Procfile:
相同的目录中运行命令/Users/christopherspears/PyDevel/tapeworm_django
(tapeworm_django)Christophers-MacBook-Pro-2:tapeworm_django christopherspears$ ls *
README.md requirements.txt
tapeworm:
Procfile drawings/ manage.py* tapeworm/ templates/
任何提示?
更新:
我可以让它在本地运行:
(tapeworm_django)Christophers-MacBook-Pro-2:tapeworm christopherspears$ foreman start
16:43:17 web.1 | started with pid 2366
16:43:17 web.1 | 2014-03-29 16:43:17 [2366] [INFO] Starting gunicorn 18.0
16:43:17 web.1 | 2014-03-29 16:43:17 [2366] [INFO] Listening at: http://0.0.0.0:5000 (2366)
16:43:17 web.1 | 2014-03-29 16:43:17 [2366] [INFO] Using worker: sync
16:43:17 web.1 | 2014-03-29 16:43:17 [2369] [INFO] Booting worker with pid: 2369
答案 0 :(得分:0)
我设法让这个工作。首先,我将Procfile上移了一个级别,因此我的项目结构如此:
tapeworm_django/
Procfile
README.md
requirements.txt
tapeworm/
drawings/ <- app
manage.py
tapeworm/ <- project configuration folder
templates/
我将Procfile提升了一个级别,因为我发现大多数开发人员似乎将文件放在根目录中。我错了吗?
然后我将文件的内容改为
web: gunicorn tapeworm.wsgi
到
web: python tapeworm/manage.py runserver 0.0.0.0:$PORT --noreload
我不确定该解决方案是否被认为是“正确的”,因为它似乎与Django入门教程冲突:
https://devcenter.heroku.com/articles/getting-started-with-django