我試圖在heroku上部署我的簡單django專案,但我不明白如何解決這個問題
這是git push heroku master
remote: Traceback (most recent call last):
remote: File "/tmp/codon/tmp/buildpacks/0f40890b54a617ec2334fac0439a123c6a0c1136/vendor/runtime-fixer", line 8, in <module>
remote: r = f.read().strip()
remote: File "/usr/lib/python3.8/codecs.py", line 322, in decode
remote: (result, consumed) = self._buffer_decode(data, self.errors, final)
remote: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte
remote: /tmp/codon/tmp/buildpacks/0f40890b54a617ec2334fac0439a123c6a0c1136/bin/steps/python: line 5: warning: command substitution: ignored null byte in input
remote: ) is not available for this stack (heroku-20).
remote: ! Aborting. More info: https://devcenter.heroku.com/articles/python-support
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: !
remote: ! ## Warning - The same version of this code has already been built: 898dd95ff261fc77ac4dcd00edd162d7b7c054f2
remote: !
remote: ! We have detected that you have triggered a build from source code with version 898dd95ff261fc77ac4dcd00edd162d7b7c054f2
remote: ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch.
remote: !
remote: ! If you are developing on a branch and deploying via git you must run:
remote: !
remote: ! git push heroku <branchname>:main
remote: !
remote: ! This article goes into details on the behavior:
remote: ! https://devcenter.heroku.com/articles/duplicate-build-version
remote:
remote: Verifying deploy...
remote:
remote: ! Push rejected to portfolio-project10.
remote:
To https://git.heroku.com/portfolio-project10.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/portfolio-project10.git'
C:...\portfolio-project>
如果有人可以幫助我,或者甚至推薦另一種免費部署 django 專案的方式,那就太好了
uj5u.com熱心網友回復:
整個回溯都在這些括號內:() is not available for this stack. 這是當您請求不可用的 Python 運行時時顯示的訊息。在這種情況下,由于意外編碼,您runtime.txt甚至無法讀取。
洗掉它,然后創建一個包含類似內容的新檔案
python-3.10.2
只要。確保它是 UTF-8 編碼、提交和重新部署。
目前,這些是當前支持的 Python 版本,但隨著新版本的發布,串列會發生變化:
python-3.10.2python-3.9.10python-3.8.12python-3.7.12
轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/428153.html
