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

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

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

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

Git

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

Heroku

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

Python 3.x

Python 3はPythonプログラミング言語の最新バージョンであり、2008年12月3日にリリースされました。

Q&A

解決済

1回答

1988閲覧

Djangogirlsチュートリアル中のHerokuへのデプロイでつまずいています。

waitohujin

総合スコア11

Django

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

Git

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

Heroku

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

Python 3.x

Python 3はPythonプログラミング言語の最新バージョンであり、2008年12月3日にリリースされました。

0グッド

0クリップ

投稿2018/07/31 11:20

編集2018/07/31 11:38

デプロイが実行できない

コマンドプロントにおいて、git push heroku masterを実行したところ、エラーが発生してしまいました。他者様の質問と回答を見比べて修正していったのですが、どうしてもエラーが発生してしまいます。

error: failed to push some refs to 'https://git.heroku.com/kinnennnichousen.git'

(myvenv) C:\Users\waito_000\djangogirl>git push heroku master Enumerating objects: 24, done. Counting objects: 100% (24/24), done. Delta compression using up to 4 threads. Compressing objects: 100% (21/21), done. Writing objects: 100% (24/24), 4.74 KiB | 285.00 KiB/s, done. Total 24 (delta 3), reused 0 (delta 0) remote: Compressing source files... done. remote: Building source: remote: remote: -----> Python app detected remote: ! The latest version of Python 3.6 is python-3.6.6 (you are using python-3.6.5, which is unsupported). remote: ! We recommend upgrading by specifying the latest version (python-3.6.6). remote: Learn More: https://devcenter.heroku.com/articles/python-runtimes remote: -----> Installing python-3.6.5 remote: -----> Installing pip remote: -----> Installing requirements with pip remote: Collecting dj-database-url==0.5.0 (from -r /tmp/build_73a7750bc4c292afd6f9843f75de1a20/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.0.7 (from -r /tmp/build_73a7750bc4c292afd6f9843f75de1a20/requirements.txt (line 2)) remote: Downloading https://files.pythonhosted.org/packages/ab/15/cfde97943f0db45e4f999c60b696fbb4df59e82bbccc686770f4e44c9094/Django-2.0.7-py3-none-any.whl (7.1MB) remote: Collecting gunicorn==19.9.0 (from -r /tmp/build_73a7750bc4c292afd6f9843f75de1a20/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 pytz==2018.5 (from -r /tmp/build_73a7750bc4c292afd6f9843f75de1a20/requirements.txt (line 4)) remote: Downloading https://files.pythonhosted.org/packages/30/4e/27c34b62430286c6d59177a0842ed90dc789ce5d1ed740887653b898779a/pytz-2018.5-py2.py3-none-any.whl (510kB) remote: Collecting whitenoise==3.3.1 (from -r /tmp/build_73a7750bc4c292afd6f9843f75de1a20/requirements.txt (line 5)) remote: Downloading https://files.pythonhosted.org/packages/0c/58/0f309a821b9161d0e3a73336a187d1541c2127aff7fdf3bf7293f9979d1d/whitenoise-3.3.1-py2.py3-none-any.whl remote: Collecting psycopg2==2.7.5 (from -r /tmp/build_73a7750bc4c292afd6f9843f75de1a20/requirements.txt (line 6)) remote: Downloading https://files.pythonhosted.org/packages/5e/d0/9e2b3ed43001ebed45caf56d5bb9d44ed3ebd68e12b87845bfa7bcd46250/psycopg2-2.7.5-cp36-cp36m-manylinux1_x86_64.whl (2.7MB) remote: Installing collected packages: dj-database-url, pytz, Django, gunicorn, whitenoise, psycopg2 remote: Successfully installed Django-2.0.7 dj-database-url-0.5.0 gunicorn-19.9.0 psycopg2-2.7.5 pytz-2018.5 whitenoise-3.3.1 remote: remote: -----> $ python manage.py collectstatic --noinput remote: Traceback (most recent call last): remote: File "manage.py", line 15, in <module> remote: execute_from_command_line(sys.argv) remote: File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/__init__.py", line 371, in execute_from_command_line remote: utility.execute() remote: File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/__init__.py", line 317, in execute remote: settings.INSTALLED_APPS remote: File "/app/.heroku/python/lib/python3.6/site-packages/django/conf/__init__.py", line 56, in __getattr__ remote: self._setup(name) remote: File "/app/.heroku/python/lib/python3.6/site-packages/django/conf/__init__.py", line 43, in _setup remote: self._wrapped = Settings(settings_module) remote: File "/app/.heroku/python/lib/python3.6/site-packages/django/conf/__init__.py", line 106, in __init__ remote: mod = importlib.import_module(self.SETTINGS_MODULE) remote: File "/app/.heroku/python/lib/python3.6/importlib/__init__.py", line 126, in import_module remote: return _bootstrap._gcd_import(name[level:], package, level) remote: File "<frozen importlib._bootstrap>", line 994, in _gcd_import remote: File "<frozen importlib._bootstrap>", line 971, in _find_and_load remote: File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked remote: File "<frozen importlib._bootstrap>", line 665, in _load_unlocked remote: File "<frozen importlib._bootstrap_external>", line 678, in exec_module remote: File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed remote: File "/tmp/build_73a7750bc4c292afd6f9843f75de1a20/mysite1/settings.py", line 124, in <module> remote: DATABASE['default'] = dj_database_url.config() remote: NameError: name 'DATABASE' is not defined remote: remote: ! Error while running '$ python manage.py collectstatic --noinput'. remote: See traceback above for details. remote: remote: You may need to update application code to resolve this error. remote: Or, you can disable collectstatic for this application: remote: remote: $ heroku config:set DISABLE_COLLECTSTATIC=1 remote: remote: https://devcenter.heroku.com/articles/django-assets remote: ! Push rejected, failed to compile Python app. remote: remote: ! Push failed remote: Verifying deploy... remote: remote: ! Push rejected to kinnennnichousen. remote: To https://git.heroku.com/kinnennnichousen.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/kinnennnichousen.git'

試したこと

requirements.txt内のpsycopg2最新版に更新。gitへのコミット。

補足情報(FW/ツールのバージョンなど)

python 3.6.5
django 2.0.7
atom
git for windows10

djangogirls tutorial デプロイ!
https://djangogirlsjapan.gitbooks.io/workshop_tutorialjp/deploy/

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

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

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

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

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

guest

回答1

0

ベストアンサー

DATABASE['default'] = dj_database_url.config() NameError: name 'DATABASE' is not defined

とあります。
mysite/local_settings.pyにDATABASEの定義を書いたか、mysite/settings.pyに追加した記述が最終行になっているかなど、DATABASE関連のコードを確認するとよいと思います。

投稿2018/07/31 12:52

Udomomo

総合スコア1524

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

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

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問