我想将Django应用程序部署到Heroku,但是在尝试推送时遇到了麻烦。当我运行git push heroku master
时说:
Counting objects: 99, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (97/97), done.
Writing objects: 100% (99/99), 2.51 MiB | 98.00 KiB/s, done.
Total 99 (delta 22), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> App not compatible with buildpack: https://buildpack-registry.s3.amazonaws.com/buildpacks/heroku/python.tgz
remote: More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to mammadovs.
remote:
To https://git.heroku.com/mammadovs.git
我通过运行heroku buildpacks:set heroku/python
手动设置buildpack。
答案 0 :(得分:0)
您尚未声明任何依赖项。
确定要使用<div class="form-group {{ $errors->has('fk_payment') ? 'has-error' : '' }}">
<label for="company-content">Payment </label>
<select name="fk_payment" id="fk_payment" class="form-control" required="required" value="{{ old('fk_payment')}}"/>
<option value="">Choice Payment</option>
@foreach($payments as $payment)
@php
$training = App\Training::where('fk_payment', $payment->fk_payment)->first();
@endphp
<option value="{{$payment->id}}" {{ old('fk_payment') == $payment->id ? 'selected' : '' }} >
{{ $training->type_sitting )}}
</option>
@endforeach
{!! $errors->first('fk_payment', '<span class="help-block">:message</span>') !!}
</select>
还是Pipenv
并将适当的依赖项文件添加到存储库中。如果您不熟悉此方法,最简单的解决方案可能是添加一个包含以下内容的pip
文件
requirements.txt
到项目中的根目录。如果您还有其他依赖项,也请添加它们。然后提交文件并重新部署。
定义依赖项很重要,您应该始终将其作为最佳实践。但这是Heroku上的必需。 Heroku还怎么知道应该安装Django和您使用的其他任何库?
请参见https://devcenter.heroku.com/articles/getting-started-with-python#declare-app-dependencies