前提・実現したいこと
HerokuにデプロイしようとしたらServer Error (500)が
出てハマっております。
heroku open後URLに接続したらエラーの詳細等表示されずに
この画像が表示されます。
該当のソースコード
requirements
1 2alabaster==0.7.12 3asn1crypto==0.24.0 4astroid==2.2.5 5attrs==19.1.0 6Babel==2.6.0 7backcall==0.1.0 8bleach==3.1.0 9certifi==2019.3.9 10cffi==1.12.2 11chardet==3.0.4 12cloudpickle==0.8.1 13colorama==0.4.1 14cryptography==2.6.1 15cycler==0.10.0 16decorator==4.4.0 17defusedxml==0.5.0 18dj-database-url==0.5.0 19Django==2.1.7 20django-heroku==0.3.1 21docutils==0.14 22entrypoints==0.3 23gunicorn==19.9.0 24idna==2.8 25imagesize==1.1.0 26ipykernel==5.1.0 27ipython==7.4.0 28ipython-genutils==0.2.0 29isort==4.3.17 30jedi==0.13.3 31Jinja2==2.10.1 32jsonschema==3.0.1 33jupyter-client==5.2.4 34jupyter-core==4.4.0 35keyring==18.0.0 36kiwisolver==1.1.0 37lazy-object-proxy==1.3.1 38MarkupSafe==1.1.1 39matplotlib==3.1.0 40mccabe==0.6.1 41mistune==0.8.4 42nbconvert==5.4.1 43nbformat==4.4.0 44numpy==1.16.4 45numpydoc==0.8.0 46packaging==19.0 47pandocfilters==1.4.2 48parso==0.4.0 49pickleshare==0.7.5 50prompt-toolkit==2.0.9 51psutil==5.6.1 52psycopg2==2.8.2 53pycodestyle==2.5.0 54pycparser==2.19 55pyflakes==2.1.1 56Pygments==2.3.1 57pylint==2.3.1 58pyOpenSSL==19.0.0 59pyparsing==2.4.0 60pyrsistent==0.14.11 61PySocks==1.6.8 62python-dateutil==2.8.0 63pytz==2019.1 64pyzmq==18.0.0 65QtAwesome==0.5.7 66qtconsole==4.4.3 67QtPy==1.7.0 68requests==2.21.0 69rope==0.12.0 70six==1.12.0 71snowballstemmer==1.2.1 72Sphinx==2.0.1 73sphinxcontrib-applehelp==1.0.1 74sphinxcontrib-devhelp==1.0.1 75sphinxcontrib-htmlhelp==1.0.2 76sphinxcontrib-jsmath==1.0.1 77sphinxcontrib-qthelp==1.0.2 78sphinxcontrib-serializinghtml==1.1.1 79spyder==3.3.4 80spyder-kernels==0.4.4 81testpath==0.4.2 82tornado==6.0.2 83traitlets==4.3.2 84typed-ast==1.3.1 85urllib3==1.24.1 86virtualenv==16.5.0 87wcwidth==0.1.7 88webencodings==0.5.1 89whitenoise==4.1.2 90win-inet-pton==1.1.0 91wincertstore==0.2 92wrapt==1.11.1
herokulog
12019-06-01T13:24:35.506425+00:00 heroku[router]: at=info method=GET path="/" host=yonetomodjango.herokuapp.com request_id=eb97104a-3f67-4752-9632-6fb940abebaa fwd="123.216.62.249" dyno=web.1 connect=1ms service=5ms status=404 bytes=258 protocol=https 22019-06-01T13:24:35.503534+00:00 app[web.1]: 10.31.92.177 - - [01/Jun/2019:22:24:35 +0900] "GET / HTTP/1.1" 404 77 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36 Edge/18.17763" 32019-06-01T13:25:20.229746+00:00 heroku[router]: at=info method=GET path="/dev/top" host=yonetomodjango.herokuapp.com request_id=d258e676-d54b-4dfd-8969-baa162497ef1 fwd="123.216.62.249" dyno=web.1 connect=1ms service=225ms status=500 bytes=234 protocol=https 42019-06-01T13:25:20.226342+00:00 app[web.1]: 10.31.92.177 - - [01/Jun/2019:22:25:20 +0900] "GET /dev/top HTTP/1.1" 500 27 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36 Edge/18.17763"
上記はheroku logsで出力したログです。
●settings.py(herokuを利用するにあたり追加した設定のみ記述してます) ・ ・ ・ ALLOWED_HOSTS = ['.herokuapp.com'] # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/2.1/howto/static-files/ STATIC_URL = '/static/' DEBUG = False try: from .local_settings import * except ImportError: pass if not DEBUG: import django_heroku django_heroku.settings(locals()) # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/1.9/howto/static-files/ STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles') STATIC_URL = '/static/' STATICFILES_DIRS = ( os.path.join(BASE_DIR, 'static'), ) MIDDLEWARE_CLASSES = ( # Simplified static file serving. # https://warehouse.python.org/project/whitenoise/ 'whitenoise.middleware.WhiteNoiseMiddleware', )
試したこと
・上記のsettings.pyに追加した内容。
・pipでwhitenoiseのインストール
回答1件
あなたの回答
tips
プレビュー