Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/355.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
推送被拒绝,未能编译Python应用程序;不要将Django应用程序部署到Heroku_Python_Django_Git_Heroku_Python 3.7 - Fatal编程技术网

推送被拒绝,未能编译Python应用程序;不要将Django应用程序部署到Heroku

推送被拒绝,未能编译Python应用程序;不要将Django应用程序部署到Heroku,python,django,git,heroku,python-3.7,Python,Django,Git,Heroku,Python 3.7,我是初学者,通过本文了解了如何将Django应用程序部署到生产环境中 这本书的作者有一个django应用程序,我可以把它推给heroku。我复制/粘贴了这个,并添加了一些东西。我无法将我的存储库推送到heroku,也无法找到导致问题的我和他回购协议之间的不同之处 我试着在这里找到解决办法 这里 和其他文章,但没有结果 这是我推送存储库时的控制台。出现错误 (my_django_environment) C:\Users\123\altai_application1>git push her

我是初学者,通过本文了解了如何将Django应用程序部署到生产环境中

这本书的作者有一个django应用程序,我可以把它推给heroku。我复制/粘贴了这个,并添加了一些东西。我无法将我的存储库推送到heroku,也无法找到导致问题的我和他回购协议之间的不同之处

我试着在这里找到解决办法

这里

和其他文章,但没有结果

这是我推送存储库时的控制台。出现错误

(my_django_environment) C:\Users\123\altai_application1>git push heroku master
Enumerating objects: 179, done.
Counting objects: 100% (179/179), done.
Delta compression using up to 4 threads
Compressing objects: 100% (106/106), done.
Writing objects: 100% (179/179), 62.07 KiB | 2.96 MiB/s, done.
Total 179 (delta 71), reused 151 (delta 55)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote:  !     Python has released a security update! Please consider upgrading to python-3.7.3
remote:        Learn More: https://devcenter.heroku.com/articles/python-runtimes
remote: -----> Installing python-3.7.4
remote: -----> Installing pip
remote: -----> Installing SQLite3
remote: -----> Installing requirements with pip
remote:  !     Push rejected, failed to compile Python app.
remote:
remote:  !     Push failed
remote: Verifying deploy...
remote:
remote: !       Push rejected to altaisite.
remote:
To https://git.heroku.com/altaisite.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/altaisite.git'
这是我推送原始存储库时的控制台。没有错误

(my_django_environment) C:\Users\123\django-locallibrary-tutorial>git push heroku master
Enumerating objects: 335, done.
Counting objects: 100% (335/335), done.
Delta compression using up to 4 threads
Compressing objects: 100% (145/145), done.
Writing objects: 100% (335/335), 151.21 KiB | 12.60 MiB/s, done.
Total 335 (delta 181), reused 335 (delta 181)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote:  !     Python has released a security update! Please consider upgrading to python-3.7.3
remote:        Learn More: https://devcenter.heroku.com/articles/python-runtimes
remote: -----> Installing python-3.7.0
remote: -----> Installing pip
remote: -----> Installing SQLite3
remote: -----> Installing requirements with pip
remote:        Collecting dj-database-url==0.5.0 (from -r /tmp/build_785b99783524456d576c234409aaba06/requirements.txt (line 1))
remote:          Downloading https://files.pythonhosted.org/packages/d4/a6/4b8578c1848690d0c307c7c0596af2077536c9ef2a04d42b00fabaa7e49d/dj_database_url-0.5.0-py2.py3-none-any.whl
remote:        Collecting Django==2.1.5 (from -r /tmp/build_785b99783524456d576c234409aaba06/requirements.txt (line 2))
remote:          Downloading https://files.pythonhosted.org/packages/36/50/078a42b4e9bedb94efd3e0278c0eb71650ed9672cdc91bd5542953bec17f/Django-2.1.5-py3-none-any.whl (7.3MB)
remote:        Collecting gunicorn==19.9.0 (from -r /tmp/build_785b99783524456d576c234409aaba06/requirements.txt (line 3))
remote:          Downloading https://files.pythonhosted.org/packages/8c/da/b8dd8deb741bff556db53902d4706774c8e1e67265f69528c14c003644e6/gunicorn-19.9.0-py2.py3-none-any.whl (112kB)
remote:        Collecting psycopg2-binary==2.7.7 (from -r /tmp/build_785b99783524456d576c234409aaba06/requirements.txt (line 4))
remote:          Downloading https://files.pythonhosted.org/packages/04/c3/fbf0ec416151ce082087bfbb42f236ec42c2c74d2d9f7a5b5cdf49cfc517/psycopg2_binary-2.7.7-cp37-cp37m-manylinux1_x86_64.whl (2.7MB)
remote:        Collecting wheel==0.30.0 (from -r /tmp/build_785b99783524456d576c234409aaba06/requirements.txt (line 5))
remote:          Downloading https://files.pythonhosted.org/packages/0c/80/16a85b47702a1f47a63c104c91abdd0a6704ee8ae3b4ce4afc49bc39f9d9/wheel-0.30.0-py2.py3-none-any.whl (49kB)
remote:        Collecting whitenoise==4.1.2 (from -r /tmp/build_785b99783524456d576c234409aaba06/requirements.txt (line 6))
remote:          Downloading https://files.pythonhosted.org/packages/fd/2a/b51377ab9826f0551da19951257d2434f46329cd6cfdf9592ea9ca5f6034/whitenoise-4.1.2-py2.py3-none-any.whl
remote:        Collecting pytz (from Django==2.1.5->-r /tmp/build_785b99783524456d576c234409aaba06/requirements.txt (line 2))
remote:          Downloading https://files.pythonhosted.org/packages/87/76/46d697698a143e05f77bec5a526bf4e56a0be61d63425b68f4ba553b51f2/pytz-2019.2-py2.py3-none-any.whl (508kB)
remote:        Installing collected packages: dj-database-url, pytz, Django, gunicorn, psycopg2-binary, wheel, whitenoise
remote:          Found existing installation: wheel 0.33.6
remote:            Uninstalling wheel-0.33.6:
remote:              Successfully uninstalled wheel-0.33.6
remote:        Successfully installed Django-2.1.5 dj-database-url-0.5.0 gunicorn-19.9.0 psycopg2-binary-2.7.7 pytz-2019.2 wheel-0.30.0 whitenoise-4.1.2
remote:
remote: -----> $ python manage.py collectstatic --noinput
remote:        121 static files copied to '/tmp/build_785b99783524456d576c234409aaba06/staticfiles', 379 post-processed.
remote:
remote: -----> Discovering process types
remote:        Procfile declares types -> web
remote:
remote: -----> Compressing...
remote:        Done: 57.3M
remote: -----> Launching...
remote:        Released v5
remote:        https://mdnaltai.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy... done.
To https://git.heroku.com/mdnaltai.git
 * [new branch]      master -> master
我想把我的存储库推到heroku。知道我错过了什么吗


对不起,我的英语不好,我来自俄罗斯

看起来你的Python版本不起作用了。 尝试使用python-3.6.8更改runtime.txt文件
这对我很有用。

可能会有帮助。
runtime.txt
你是说
requirements.txt
还是那是一个单独的文件?