Jac*_*lin 17 python django heroku
我正在尝试将一个大型django项目部署到heroku.我安装了Heroku CLI,登录,创建了一个应用程序并运行:
git push heroku master
我已经设置了Pipfile和requirements.txt.我添加了一个runtime.txt来指定我需要python 2.7.这也在Pipfile中.这是我从推送到heroku得到的:
$ git push heroku master
Counting objects: 12159, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (4853/4853), done.
Writing objects: 100% (12159/12159), 20.94 MiB | 1.82 MiB/s, done.
Total 12159 (delta 6859), reused 12036 (delta 6751)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: -----> Installing python-3.6.4
remote: -----> Installing pip
remote: -----> Installing dependencies with Pipenv 11.8.2…
remote: Your Pipfile.lock (3b2ba9) is out of date. Expected: (83a5b4).
remote: Aborting deploy.
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: Verifying deploy....
remote:
remote: ! Push rejected to camp-infinity.
remote:
To https://git.heroku.com/camp-infinity.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/camp-infinity.git'
Run Code Online (Sandbox Code Playgroud)
由于某种原因,它试图安装python 3,它也不喜欢我的Pipfile.lock文件.我已经尝试删除它并使用pipenv安装再次生成它,但这并没有改变任何东西.
MNS*_*NSH 26
在项目工作中遇到同样的问题,在你推动Heroku的分支中运行
pipenv lock
Run Code Online (Sandbox Code Playgroud)
它将更新Pipfile.lock文件.:)
您应该提供:
Pipfile以及相应的Pipfile.lock或者
requirements.txt(和可选runtime.txt)如果您使用的是Pipfilethengit rm requirements.txt runtime.txt并确保git add Pipfile Pipfile.lock. git commit然后尝试你git push的heroku。
https://devcenter.heroku.com/articles/python-runtimes
| 归档时间: |
|
| 查看次数: |
10428 次 |
| 最近记录: |