前提
PythonのDjangoを使ってWebアプリケーションを作るのが初めてで、herokuでデプロイするのも初めてです。https://startlab.jp/learning-python/django-heroku/
上記の参考サイトなどを見ながらデプロイ作業を進めていたのですが、最後のところで$ git push heroku mainを実行すると、
error: failed to push some refs to 'https://git.heroku.com/pmapp-django.git'
と出てきてしまい先に進めません。
https://qiita.com/mizoe@github/items/0f7898fe026fa4cefe9d
こちらのサイトも参考にし、仮想環境を作って実行したのですが解決に至りませんでした。どうしても解決したいので解決策を教えていただきたいです。
・python バージョン3.7.13
エラーコード
(heroku_env) (Django) x20008xx@kazusan myproject % git push heroku master
error: src refspec master does not match any
error: failed to push some refs to 'https://git.heroku.com/pmapp-django.git'
(heroku_env) (Django) x20008xx@kazusan myproject % git push heroku main
Enumerating objects: 6113, done.
Counting objects: 100% (6113/6113), done.
Delta compression using up to 4 threads
Compressing objects: 100% (3281/3281), done.
Writing objects: 100% (6102/6102), 6.08 MiB | 2.73 MiB/s, done.
Total 6102 (delta 1779), reused 6087 (delta 1772), pack-reused 0
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Building on the Heroku-22 stack
remote: -----> Using buildpack: heroku/python
remote: -----> Python app detected
remote: -----> Using Python version specified in runtime.txt
remote: ! Requested runtime 'python-3.7.13' is not available for this stack (heroku-22).
remote: ! For supported versions, see: 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 pmapp-django.
remote:
To https://git.heroku.com/pmapp-django.git
! [remote rejected] main -> main (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/pmapp-django.git'
試したこと
仮想環境を作って、Herokuに必要なライブラリだけを pip install してから pip freeze でrequirements.txtを作成
$ python -m venv heroku_env
$ source heroku_env/bin/activate
$ pip install --upgrade pip
$ pip install django-toolbelt
$ pip freeze > requirements.txt
$ git add .
$ git commit -m 'comment'
$ git push heroku main
エラーコードの内容的にpythonのinstallもしくはバージョンがうまく設定できていないのでしょうか?教えていただきたいです。
あなたの回答
tips
プレビュー