質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Django

DjangoはPythonで書かれた、オープンソースウェブアプリケーションのフレームワークです。複雑なデータベースを扱うウェブサイトを開発する際に必要な労力を減らす為にデザインされました。

Git

Gitはオープンソースの分散バージョン管理システム(DVCS)です。

Heroku

HerokuはHeroku社が開発と運営を行っているPaaSの名称です。RubyやNode.js、Python、そしてJVMベース(Java、Scala、Clojureなど)の複数のプログラミング言語をサポートしている。

コマンドプロンプト

コマンドプロンプト(cmd.exe)はMicrosoftによって提供されているコマンドラインインタプリタです。OS/2・Windows CE・Windows NTで使用可能です。

Python

Pythonは、コードの読みやすさが特徴的なプログラミング言語の1つです。 強い型付け、動的型付けに対応しており、後方互換性がないバージョン2系とバージョン3系が使用されています。 商用製品の開発にも無料で使用でき、OSだけでなく仮想環境にも対応。Unicodeによる文字列操作をサポートしているため、日本語処理も標準で可能です。

Q&A

解決済

1回答

5461閲覧

Djangoのデプロイに関して。(git push heroku masterがうまくいかない)

KazuvinHarris

総合スコア9

Django

DjangoはPythonで書かれた、オープンソースウェブアプリケーションのフレームワークです。複雑なデータベースを扱うウェブサイトを開発する際に必要な労力を減らす為にデザインされました。

Git

Gitはオープンソースの分散バージョン管理システム(DVCS)です。

Heroku

HerokuはHeroku社が開発と運営を行っているPaaSの名称です。RubyやNode.js、Python、そしてJVMベース(Java、Scala、Clojureなど)の複数のプログラミング言語をサポートしている。

コマンドプロンプト

コマンドプロンプト(cmd.exe)はMicrosoftによって提供されているコマンドラインインタプリタです。OS/2・Windows CE・Windows NTで使用可能です。

Python

Pythonは、コードの読みやすさが特徴的なプログラミング言語の1つです。 強い型付け、動的型付けに対応しており、後方互換性がないバージョン2系とバージョン3系が使用されています。 商用製品の開発にも無料で使用でき、OSだけでなく仮想環境にも対応。Unicodeによる文字列操作をサポートしているため、日本語処理も標準で可能です。

0グッド

0クリップ

投稿2018/08/16 20:05

前提・実現したいこと

ここに質問の内容を詳しく書いてください。
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の内訳です。
![イメージ説明

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

Meganezaru

2018/08/16 23:47

pushしているプロジェクトのディレクトリ・ファイル構成を提示してもらえると、原因が見つけやすいと思います。
KazuvinHarris

2018/08/17 17:08

ご指摘ありがとうございます!綴りミスとファイルのアップデートが原因でした...
guest

回答1

0

ベストアンサー

プロジェクトルートに requirements.txt あるいは Pipfile がないのではないでしょうか?

投稿2018/08/17 01:23

退会済みユーザー

退会済みユーザー

総合スコア0

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

KazuvinHarris

2018/08/17 17:07

requirements.txtの綴りミスとpsycopg2のアップデート不足でした... ご指摘ありがとうございます!!
ikohs

2018/08/21 10:31

お世話になります。私も同じ現象が起きているのですが、対処方法をご教示頂けないでしょうか。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問