Djangoのデプロイに関して。(git push heroku masterがうまくいかない)
解決済
回答 1
投稿
- 評価
- クリップ 0
- VIEW 2,387
前提・実現したいこと
ここに質問の内容を詳しく書いてください。
Djangoで簡易的なブログを作っています。(djangogirlsを参考に)
デプロイをする際に、コマンドプロンプト上に以下のエラーメッセージが発生しました。
発生している問題・エラーメッセージ
C:\Users\marus\djangogirls>git push heroku master
Enumerating objects: 22, done.
Counting objects: 100% (22/22), done.
Delta compression using up to 4 threads.
Compressing objects: 100% (18/18), done.
Writing objects: 100% (22/22), 4.77 KiB | 407.00 KiB/s, done.
Total 22 (delta 0), 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 kazuvinharris.
remote:
To https://git.heroku.com/kazuvinharris.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/kazuvinharris.git'
該当のソースコード
試したこと
ここに問題に対して試したことを記載してください。
1回目にgit push heroku masterを行ったときに
C:\Users\marus\djangogirls>git push heroku master
Enumerating objects: 22, done.
Counting objects: 100% (22/22), done.
Delta compression using up to 4 threads.
Compressing objects: 100% (18/18), done.
Writing objects: 100% (22/22), 4.77 KiB | 444.00 KiB/s, done.
Total 22 (delta 0), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: ! No default language could be detected for this app.
remote: HINT: This occurs when Heroku cannot detect the buildpack to use for this application automatically.
remote: See https://devcenter.heroku.com/articles/buildpacks
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to kazuvinharris.
remote:
To https://git.heroku.com/kazuvinharris.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/kazuvinharris.git'
と出たので、13行目のSeeのリンク先を参考にheroku buildpacks:set heroku/pythonをコンソールしました。
そしてそれを踏まえて、2回目のgit push heroku masterを行いました。
C:\Users\marus\djangogirls>heroku buildpacks:set heroku/python
Buildpack set. Next release on kazuvinharris will use heroku/python.
Run git push heroku master to create a new release using this buildpack.
C:\Users\marus\djangogirls>git push heroku master
Enumerating objects: 22, done.
Counting objects: 100% (22/22), done.
Delta compression using up to 4 threads.
Compressing objects: 100% (18/18), done.
Writing objects: 100% (22/22), 4.77 KiB | 444.00 KiB/s, done.
Total 22 (delta 0), 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 kazuvinharris.
remote:
To https://git.heroku.com/kazuvinharris.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/kazuvinharris.git'
とこのようにまたしてもデプロイができなかったので、More info先にあったリンク(https://devcenter.heroku.com/articles/buildpacks#detection-failure)を参考に、一度Herokuのアプリケーションを消した後、同じ名前のアプリを作成後
heroku create kazuvinharris --buildpack heroku/pythonとコンソールしました。そして3回目のgit push heroku masterを行いました。
C:\Users\marus\djangogirls>git push heroku master
Enumerating objects: 22, done.
Counting objects: 100% (22/22), done.
Delta compression using up to 4 threads.
Compressing objects: 100% (18/18), done.
Writing objects: 100% (22/22), 4.77 KiB | 407.00 KiB/s, done.
Total 22 (delta 0), 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 kazuvinharris.
remote:
To https://git.heroku.com/kazuvinharris.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/kazuvinharris.git'
とこのように表示され煮詰まったので質問させていただきました。
補足情報(FW/ツールのバージョンなど)
使用のコードエディタ:Visual Studio Code
Python-3.6.6.
Django 1.11
ここにより詳細な情報を記載してください。
言語が検出されていないことがエラーの原因であると思っています。
心当たりとしては、コードエディタを使用する際、.vscodeファイルが作成され、その言語がjsonであったことです。
ファイルとgit logとgit statusの内訳です。
-
気になる質問をクリップする
クリップした質問は、後からいつでもマイページで確認できます。
またクリップした質問に回答があった際、通知やメールを受け取ることができます。
クリップを取り消します
-
良い質問の評価を上げる
以下のような質問は評価を上げましょう
- 質問内容が明確
- 自分も答えを知りたい
- 質問者以外のユーザにも役立つ
評価が高い質問は、TOPページの「注目」タブのフィードに表示されやすくなります。
質問の評価を上げたことを取り消します
-
評価を下げられる数の上限に達しました
評価を下げることができません
- 1日5回まで評価を下げられます
- 1日に1ユーザに対して2回まで評価を下げられます
質問の評価を下げる
teratailでは下記のような質問を「具体的に困っていることがない質問」、「サイトポリシーに違反する質問」と定義し、推奨していません。
- プログラミングに関係のない質問
- やってほしいことだけを記載した丸投げの質問
- 問題・課題が含まれていない質問
- 意図的に内容が抹消された質問
- 広告と受け取られるような投稿
評価が下がると、TOPページの「アクティブ」「注目」タブのフィードに表示されにくくなります。
質問の評価を下げたことを取り消します
この機能は開放されていません
評価を下げる条件を満たしてません
質問の評価を下げる機能の利用条件
この機能を利用するためには、以下の事項を行う必要があります。
- 質問回答など一定の行動
-
メールアドレスの認証
メールアドレスの認証
-
質問評価に関するヘルプページの閲覧
質問評価に関するヘルプページの閲覧
15分調べてもわからないことは、teratailで質問しよう!
- ただいまの回答率 89.97%
- 質問をまとめることで、思考を整理して素早く解決
- テンプレート機能で、簡単に質問をまとめられる
質問への追記・修正、ベストアンサー選択の依頼
Meganezaru
2018/08/17 08:47
pushしているプロジェクトのディレクトリ・ファイル構成を提示してもらえると、原因が見つけやすいと思います。
KazuvinHarris
2018/08/18 02:08
ご指摘ありがとうございます!綴りミスとファイルのアップデートが原因でした...