![](/img/trans.png)
[英]How can i solve a migration issue in django project hosted on heroku?
[英]I can not register my Django project on Heroku
我今天將python版本從3.6.4更新到了3.6.5。 這是因為在分發到Heroku的過程中,建議使用版本3.6.5。 因此,確認了以下動力殼內容物。
Writing objects: 100% (35/35), 11.68 KiB | 0 bytes/s, done.
Total 35 (delta 3), reused 0 (delta 0)
remote: Compressing source files... done.
remote: -----> Python app detected
remote: ! The latest version of Python 3 is python-3.6.5 (you are using ÿþpython-3.6.5, which is unsupported).
remote: ! We recommend upgrading by specifying the latest version (python-3.6.5).
remote: Learn More: https://devcenter.heroku.com/articles/python-runtimes
remote: -----> Installing ÿþpython-3.6.5
remote: ! Requested runtime (ÿþpython-3.6.5) is not available for this stack (heroku-16).
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: ! Push rejected to XXXXXXXX.
remote:
To https://git.heroku.com/XXXXXXXX.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/XXXXXXXX.git
將runtime.txt
文件更改為UTF-8后,現在出現以下錯誤:
Writing objects: 100% (35/35), 11.68 KiB | 0 bytes/s, done.
Total 35 (delta 3), reused 0 (delta 0)
remote: Compressing source files... done.
remote: -----> Python app detected
remote: ! The latest version of Python 3 is python-3.6.5 (you are using python-3.6.5, which is unsupported).
remote: ! We recommend upgrading by specifying the latest version (python-3.6.5).
remote: Learn More: https://devcenter.heroku.com/articles/python-runtimes
remote: -----> Installing python-3.6.5
remote: ! Requested runtime (python-3.6.5) is not available for this stack (heroku-16).
remote: ! Aborting. More info: https://devcenter.heroku.com/articles/python-support
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to XXXXXXXX.
remote:
To https://git.heroku.com/XXXXXXXX.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/XXXXXXXX.git
為什么python-3.6.5
被拒絕? Heroku所說的不是默認版本嗎?
你是我的好幫手。 謝謝大家!
Heroku認為您的runtime.txt
包含一些額外的字符:
ÿþpython-3.6.5
對於以little-endian順序編碼為UTF-16的文件,這可能是字節順序標記 。 確保您對該文件(和其他文件)使用了合理的編碼。 在幾乎所有情況下,UTF-8都是不錯的選擇。
您正在嘗試安裝ÿþpython-3.6.5
而不是python-3.6.5
如控制台輸出所示。 刪除ÿþ
,它應該可以正常工作。
不是這個! 太荒謬了! 我只是刪除了runtime.txt文件 ... Heroku已經很好地部署了我的Django項目。 當然會有應用程序錯誤,但是...謝謝! 每個人都告訴我一些有用的信息。 順便說一句,我仍然不知道為什么它能正常部署。 是否有理由刪除runtime.txt文件?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.