python - 在 heroku 上部署 Django 应用程序时出现错误请求

标签 python django heroku

我刚刚完成了我的第一个 Django 应用程序,但在将它部署到 Heroku 上时遇到了极大的麻烦。我必须设置 DISABLE_COLLECTSTATIC=0

简介 web: gunicorn linky.wsgi:application --log-file -

WSGI_APPLICATION = 'linky.wsgi.application'

2017-11-30T12:36:14.432878+00:00 app[api]: Release v1 created by user namangupta111@gmail.com
2017-11-30T12:36:14.432878+00:00 app[api]: Initial release by user namangupta111@gmail.com
2017-11-30T12:36:14.620376+00:00 app[api]: Release v2 created by user namangupta111@gmail.com
2017-11-30T12:36:14.620376+00:00 app[api]: Enable Logplex by user namangupta111@gmail.com
2017-11-30T12:36:53.000000+00:00 app[api]: Build started by user namangupta111@gmail.com
2017-11-30T12:36:53.000000+00:00 app[api]: Build failed -- check your build logs
2017-11-30T12:40:30.000000+00:00 app[api]: Build started by user namangupta111@gmail.com
2017-11-30T12:40:30.000000+00:00 app[api]: Build failed -- check your build logs
2017-11-30T12:42:38.000000+00:00 app[api]: Build started by user namangupta111@gmail.com
2017-11-30T12:42:38.000000+00:00 app[api]: Build failed -- check your build logs
2017-11-30T12:45:35.467417+00:00 app[api]: Release v3 created by user namangupta111@gmail.com
2017-11-30T12:45:35.467417+00:00 app[api]: Set DISABLE_COLLECTSTATIC config vars by user namangupta111@gmail.com
2017-11-30T12:45:45.000000+00:00 app[api]: Build started by user namangupta111@gmail.com
2017-11-30T12:47:42.708932+00:00 app[api]: Attach DATABASE (@ref:postgresql-solid-33244) by user namangupta111@gmail.com
2017-11-30T12:47:43.038119+00:00 app[api]: Release v5 created by user namangupta111@gmail.com
2017-11-30T12:47:42.708932+00:00 app[api]: Release v4 created by user namangupta111@gmail.com
2017-11-30T12:47:43.038119+00:00 app[api]: Deploy a591e78d by user namangupta111@gmail.com
2017-11-30T12:47:43.061780+00:00 app[api]: Scaled to web@1:Free by user namangupta111@gmail.com
2017-11-30T12:45:45.000000+00:00 app[api]: Build succeeded
2017-11-30T12:47:56.253034+00:00 heroku[web.1]: Starting process with command `gunicorn linky.wsgi:linkey --log-file -`
2017-11-30T12:47:58.504110+00:00 heroku[web.1]: Process exited with status 127
2017-11-30T12:47:58.443015+00:00 app[web.1]: bash: gunicorn: command not found
2017-11-30T12:47:58.521776+00:00 heroku[web.1]: State changed from crashed to starting
2017-11-30T12:47:58.518936+00:00 heroku[web.1]: State changed from starting to crashed
2017-11-30T12:48:11.885060+00:00 heroku[web.1]: Starting process with command `gunicorn linky.wsgi:linkey --log-file -`
2017-11-30T12:48:14.254496+00:00 heroku[web.1]: Process exited with status 127
2017-11-30T12:48:14.166440+00:00 app[web.1]: bash: gunicorn: command not found
2017-11-30T12:48:14.269577+00:00 heroku[web.1]: State changed from starting to crashed
2017-11-30T12:48:15.211378+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=sheltered-badlands-75203.herokuapp.com request_id=2b5d955d-5fde-4d7c-9fd0-9e7e424c679a fwd="117.96.248.89" dyno= connect= service= status=503 bytes= protocol=https
2017-11-30T12:48:16.880049+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=sheltered-badlands-75203.herokuapp.com request_id=a4425660-adc4-4582-8b49-9840f237d5bb fwd="117.96.248.89" dyno= connect= service= status=503 bytes= protocol=https
2017-11-30T12:48:17.297722+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=sheltered-badlands-75203.herokuapp.com request_id=da23ce45-91b0-4788-a953-3cde7aeef4b4 fwd="117.96.248.89" dyno= connect= service= status=503 bytes= protocol=https
2017-11-30T12:49:32.469741+00:00 app[api]: Starting process with command `python manage.py migrate` by user namangupta111@gmail.com
2017-11-30T12:49:47.266335+00:00 heroku[run.2918]: Awaiting client
2017-11-30T12:49:47.316114+00:00 heroku[run.2918]: Starting process with command `python manage.py migrate`
2017-11-30T12:49:47.536396+00:00 heroku[run.2918]: State changed from starting to up
2017-11-30T12:49:54.240591+00:00 heroku[run.2918]: Process exited with status 0
2017-11-30T12:49:54.254734+00:00 heroku[run.2918]: State changed from up to complete
2017-11-30T12:50:41.761897+00:00 app[api]: Starting process with command `bower install --config.interactive=false;grunt prep;python manage.py collectstatic --noinput` by user namangupta111@gmail.com
2017-11-30T12:50:54.375353+00:00 heroku[run.9979]: Awaiting client
2017-11-30T12:50:54.407017+00:00 heroku[run.9979]: Starting process with command `bower install --config.interactive=false;grunt prep;python manage.py collectstatic --noinput`
2017-11-30T12:50:54.635156+00:00 heroku[run.9979]: State changed from starting to up
2017-11-30T12:50:59.590868+00:00 heroku[run.9979]: State changed from up to complete
2017-11-30T12:50:59.561088+00:00 heroku[run.9979]: Process exited with status 1
2017-11-30T12:54:26.033901+00:00 heroku[web.1]: State changed from crashed to starting
2017-11-30T12:54:25.540698+00:00 app[api]: Remove DISABLE_COLLECTSTATIC config vars by user namangupta111@gmail.com
2017-11-30T12:54:25.540698+00:00 app[api]: Release v6 created by user namangupta111@gmail.com
2017-11-30T12:54:34.713939+00:00 app[api]: Starting process with command `python manage.py collectstatic` by user namangupta111@gmail.com
2017-11-30T12:54:42.982528+00:00 heroku[web.1]: Starting process with command `gunicorn linky.wsgi:linkey --log-file -`
2017-11-30T12:54:45.731362+00:00 app[web.1]: bash: gunicorn: command not found
2017-11-30T12:54:45.853031+00:00 heroku[web.1]: Process exited with status 127
2017-11-30T12:54:45.869535+00:00 heroku[web.1]: State changed from starting to crashed
2017-11-30T12:54:47.159216+00:00 heroku[run.8968]: Awaiting client
2017-11-30T12:54:47.182039+00:00 heroku[run.8968]: Starting process with command `python manage.py collectstatic`
2017-11-30T12:54:47.366878+00:00 heroku[run.8968]: State changed from starting to up
2017-11-30T12:55:02.290715+00:00 heroku[run.8968]: State changed from up to complete
2017-11-30T12:55:02.274872+00:00 heroku[run.8968]: Process exited with status 1
2017-11-30T12:56:13.479776+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=sheltered-badlands-75203.herokuapp.com request_id=796c5fde-ea30-4198-8422-f8c36eb26d66 fwd="117.96.248.89" dyno= connect= service= status=503 bytes= protocol=https
2017-11-30T12:56:15.768844+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=sheltered-badlands-75203.herokuapp.com request_id=c9166e9a-0097-494c-a85b-894e3f14a9c2 fwd="117.96.248.89" dyno= connect= service= status=503 bytes= protocol=https
2017-11-30T12:59:22.906900+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=sheltered-badlands-75203.herokuapp.com request_id=37e4433e-39f4-4e83-8685-a949af37f881 fwd="117.96.248.89" dyno= connect= service= status=503 bytes= protocol=https
2017-11-30T12:59:35.091261+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=sheltered-badlands-75203.herokuapp.com request_id=902fac32-a86c-457d-ae18-ef174239f420 fwd="117.96.248.89" dyno= connect= service= status=503 bytes= protocol=https
2017-11-30T13:01:20.000000+00:00 app[api]: Build started by user namangupta111@gmail.com
2017-11-30T13:01:20.000000+00:00 app[api]: Build failed -- check your build logs
2017-11-30T13:02:32.040509+00:00 heroku[web.1]: State changed from crashed to starting
2017-11-30T13:02:31.343829+00:00 app[api]: Set DISABLE_COLLECTSTATIC config vars by user namangupta111@gmail.com
2017-11-30T13:02:31.343829+00:00 app[api]: Release v7 created by user namangupta111@gmail.com
2017-11-30T13:02:45.298052+00:00 heroku[web.1]: Starting process with command `gunicorn linky.wsgi:linkey --log-file -`
2017-11-30T13:02:47.335399+00:00 app[web.1]: bash: gunicorn: command not found
2017-11-30T13:02:47.419338+00:00 heroku[web.1]: Process exited with status 127
2017-11-30T13:02:47.433086+00:00 heroku[web.1]: State changed from starting to crashed
2017-11-30T13:02:47.436595+00:00 heroku[web.1]: State changed from crashed to starting
2017-11-30T13:02:48.000000+00:00 app[api]: Build started by user namangupta111@gmail.com
2017-11-30T13:03:05.620611+00:00 heroku[web.1]: Starting process with command `gunicorn linky.wsgi:linkey --log-file -`
2017-11-30T13:03:08.295789+00:00 app[web.1]: bash: gunicorn: command not found
2017-11-30T13:03:08.395552+00:00 heroku[web.1]: Process exited with status 127
2017-11-30T13:03:08.426331+00:00 heroku[web.1]: State changed from starting to crashed
2017-11-30T13:03:52.087786+00:00 app[api]: Deploy ff2542b2 by user namangupta111@gmail.com
2017-11-30T13:03:52.550718+00:00 heroku[web.1]: State changed from crashed to starting
2017-11-30T13:03:52.087786+00:00 app[api]: Release v8 created by user namangupta111@gmail.com
2017-11-30T13:02:48.000000+00:00 app[api]: Build succeeded
2017-11-30T13:04:04.509636+00:00 heroku[web.1]: Starting process with command `gunicorn linky.wsgi:linkey --log-file -`
2017-11-30T13:04:06.320811+00:00 app[web.1]: [2017-11-30 13:04:06 +0000] [4] [INFO] Starting gunicorn 19.7.1
2017-11-30T13:04:06.321309+00:00 app[web.1]: [2017-11-30 13:04:06 +0000] [4] [INFO] Listening at: http://0.0.0.0:7904 (4)
2017-11-30T13:04:06.321389+00:00 app[web.1]: [2017-11-30 13:04:06 +0000] [4] [INFO] Using worker: sync
2017-11-30T13:04:06.324623+00:00 app[web.1]: [2017-11-30 13:04:06 +0000] [8] [INFO] Booting worker with pid: 8
2017-11-30T13:04:06.328849+00:00 app[web.1]: [2017-11-30 13:04:06 +0000] [9] [INFO] Booting worker with pid: 9
2017-11-30T13:04:06.929031+00:00 heroku[web.1]: State changed from starting to up
2017-11-30T13:04:08.349593+00:00 app[web.1]: Failed to find application: 'linky.wsgi'
2017-11-30T13:04:08.350026+00:00 app[web.1]: Failed to find application: 'linky.wsgi'
2017-11-30T13:04:08.350334+00:00 app[web.1]: [2017-11-30 13:04:08 +0000] [9] [INFO] Worker exiting (pid: 9)
2017-11-30T13:04:08.350975+00:00 app[web.1]: [2017-11-30 13:04:08 +0000] [8] [INFO] Worker exiting (pid: 8)
2017-11-30T13:04:08.576842+00:00 app[web.1]: [2017-11-30 13:04:08 +0000] [4] [INFO] Shutting down: Master
2017-11-30T13:04:08.577044+00:00 app[web.1]: [2017-11-30 13:04:08 +0000] [4] [INFO] Reason: App failed to load.
2017-11-30T13:04:08.738620+00:00 heroku[web.1]: State changed from up to crashed
2017-11-30T13:04:08.724027+00:00 heroku[web.1]: Process exited with status 4
2017-11-30T13:04:14.795507+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=sheltered-badlands-75203.herokuapp.com request_id=8a404734-5c52-48fa-8a28-df940a631635 fwd="117.96.248.89" dyno= connect= service= status=503 bytes= protocol=https
2017-11-30T13:07:42.000000+00:00 app[api]: Build started by user namangupta111@gmail.com
2017-11-30T13:08:33.671332+00:00 heroku[web.1]: State changed from crashed to starting
2017-11-30T13:08:33.424097+00:00 app[api]: Deploy 8da9ed44 by user namangupta111@gmail.com
2017-11-30T13:07:42.000000+00:00 app[api]: Build succeeded
2017-11-30T13:08:33.424097+00:00 app[api]: Release v9 created by user namangupta111@gmail.com
2017-11-30T13:08:49.364415+00:00 heroku[web.1]: Starting process with command `gunicorn linky.wsgi:application --log-file -`
2017-11-30T13:08:52.356988+00:00 app[web.1]: [2017-11-30 13:08:52 +0000] [4] [INFO] Starting gunicorn 19.7.1
2017-11-30T13:08:52.358423+00:00 app[web.1]: [2017-11-30 13:08:52 +0000] [4] [INFO] Listening at: http://0.0.0.0:14390 (4)
2017-11-30T13:08:52.358636+00:00 app[web.1]: [2017-11-30 13:08:52 +0000] [4] [INFO] Using worker: sync
2017-11-30T13:08:52.365083+00:00 app[web.1]: [2017-11-30 13:08:52 +0000] [8] [INFO] Booting worker with pid: 8
2017-11-30T13:08:52.465793+00:00 app[web.1]: [2017-11-30 13:08:52 +0000] [9] [INFO] Booting worker with pid: 9
2017-11-30T13:08:53.164791+00:00 heroku[web.1]: State changed from starting to up
2017-11-30T13:08:54.961473+00:00 app[web.1]: Invalid HTTP_HOST header: 'sheltered-badlands-75203.herokuapp.com'. You may need to add 'sheltered-badlands-75203.herokuapp.com' to ALLOWED_HOSTS.
2017-11-30T13:08:55.204271+00:00 heroku[router]: at=info method=GET path="/" host=sheltered-badlands-75203.herokuapp.com request_id=51810e99-e841-48f9-8ac2-7137064a3af2 fwd="117.96.248.89" dyno=web.1 connect=1ms service=1409ms status=400 bytes=57542 protocol=https
2017-11-30T13:10:43.000000+00:00 app[api]: Build started by user namangupta111@gmail.com
2017-11-30T13:11:32.330932+00:00 app[api]: Deploy 4e224c7a by user namangupta111@gmail.com
2017-11-30T13:11:32.330932+00:00 app[api]: Release v10 created by user namangupta111@gmail.com
2017-11-30T13:11:32.706023+00:00 heroku[web.1]: Restarting
2017-11-30T13:11:32.706796+00:00 heroku[web.1]: State changed from up to starting
2017-11-30T13:10:43.000000+00:00 app[api]: Build succeeded
2017-11-30T13:11:33.749571+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2017-11-30T13:11:33.762698+00:00 app[web.1]: [2017-11-30 13:11:33 +0000] [9] [INFO] Worker exiting (pid: 9)
2017-11-30T13:11:33.764331+00:00 app[web.1]: [2017-11-30 13:11:33 +0000] [8] [INFO] Worker exiting (pid: 8)
2017-11-30T13:11:33.765385+00:00 app[web.1]: [2017-11-30 13:11:33 +0000] [4] [INFO] Handling signal: term
2017-11-30T13:11:33.869083+00:00 app[web.1]: [2017-11-30 13:11:33 +0000] [4] [INFO] Shutting down: Master
2017-11-30T13:11:34.182406+00:00 heroku[web.1]: Process exited with status 0
2017-11-30T13:11:45.427371+00:00 heroku[web.1]: Starting process with command `gunicorn linky.wsgi:application --log-file -`
2017-11-30T13:11:47.973042+00:00 app[web.1]: [2017-11-30 13:11:47 +0000] [4] [INFO] Starting gunicorn 19.7.1
2017-11-30T13:11:47.973621+00:00 app[web.1]: [2017-11-30 13:11:47 +0000] [4] [INFO] Listening at: http://0.0.0.0:41039 (4)
2017-11-30T13:11:47.973720+00:00 app[web.1]: [2017-11-30 13:11:47 +0000] [4] [INFO] Using worker: sync
2017-11-30T13:11:47.977188+00:00 app[web.1]: [2017-11-30 13:11:47 +0000] [8] [INFO] Booting worker with pid: 8
2017-11-30T13:11:48.020288+00:00 app[web.1]: [2017-11-30 13:11:48 +0000] [9] [INFO] Booting worker with pid: 9
2017-11-30T13:11:49.232719+00:00 heroku[web.1]: State changed from starting to up
2017-11-30T13:11:50.889907+00:00 heroku[router]: at=info method=GET path="/" host=sheltered-badlands-75203.herokuapp.com request_id=c284b792-664d-4dbf-851f-cc248c9e7994 fwd="117.96.248.89" dyno=web.1 connect=1ms service=360ms status=400 bytes=199 protocol=https
2017-11-30T13:11:53.767260+00:00 heroku[router]: at=info method=GET path="/" host=sheltered-badlands-75203.herokuapp.com request_id=41d238f5-3160-416d-b826-c4028f612db3 fwd="117.96.248.89" dyno=web.1 connect=1ms service=38ms status=400 bytes=199 protocol=https
2017-11-30T13:13:22.360437+00:00 app[api]: Starting process with command `python manage.py migrate` by user namangupta111@gmail.com
2017-11-30T13:13:35.473337+00:00 heroku[run.6771]: Awaiting client
2017-11-30T13:13:35.503177+00:00 heroku[run.6771]: Starting process with command `python manage.py migrate`
2017-11-30T13:13:35.659241+00:00 heroku[run.6771]: State changed from starting to up
2017-11-30T13:13:44.074587+00:00 heroku[run.6771]: Process exited with status 0
2017-11-30T13:13:44.095902+00:00 heroku[run.6771]: State changed from up to complete
2017-11-30T13:15:46.230896+00:00 heroku[router]: at=info method=GET path="/" host=sheltered-badlands-75203.herokuapp.com request_id=7b3900ca-0e57-4e7d-b81a-ac7f20a91f5a fwd="117.96.248.89" dyno=web.1 connect=0ms service=265ms status=400 bytes=199 protocol=https
2017-11-30T13:18:13.108443+00:00 app[api]: Release v11 created by user namangupta111@gmail.com
2017-11-30T13:18:13.108443+00:00 app[api]: Set DJANGO_ALLOWED_HOSTS config vars by user namangupta111@gmail.com
2017-11-30T13:18:13.793107+00:00 heroku[web.1]: Restarting
2017-11-30T13:18:13.793107+00:00 heroku[web.1]: State changed from up to starting
2017-11-30T13:18:14.760483+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2017-11-30T13:18:14.772688+00:00 app[web.1]: [2017-11-30 13:18:14 +0000] [8] [INFO] Worker exiting (pid: 8)
2017-11-30T13:18:14.773669+00:00 app[web.1]: [2017-11-30 13:18:14 +0000] [9] [INFO] Worker exiting (pid: 9)
2017-11-30T13:18:14.773967+00:00 app[web.1]: [2017-11-30 13:18:14 +0000] [4] [INFO] Handling signal: term
2017-11-30T13:18:14.975648+00:00 app[web.1]: [2017-11-30 13:18:14 +0000] [4] [INFO] Shutting down: Master
2017-11-30T13:18:15.143039+00:00 heroku[web.1]: Process exited with status 0
2017-11-30T13:18:25.735592+00:00 heroku[web.1]: Starting process with command `gunicorn linky.wsgi:application --log-file -`
2017-11-30T13:18:27.998719+00:00 app[web.1]: [2017-11-30 13:18:27 +0000] [4] [INFO] Starting gunicorn 19.7.1
2017-11-30T13:18:27.999470+00:00 app[web.1]: [2017-11-30 13:18:27 +0000] [4] [INFO] Listening at: http://0.0.0.0:45827 (4)
2017-11-30T13:18:27.999615+00:00 app[web.1]: [2017-11-30 13:18:27 +0000] [4] [INFO] Using worker: sync
2017-11-30T13:18:28.004618+00:00 app[web.1]: [2017-11-30 13:18:28 +0000] [8] [INFO] Booting worker with pid: 8
2017-11-30T13:18:28.022408+00:00 app[web.1]: [2017-11-30 13:18:28 +0000] [9] [INFO] Booting worker with pid: 9
2017-11-30T13:18:29.338141+00:00 heroku[web.1]: State changed from starting to up
2017-11-30T13:18:30.614246+00:00 heroku[router]: at=info method=GET path="/" host=sheltered-badlands-75203.herokuapp.com request_id=d4ff720c-57e9-408a-9eb6-2c73f40eb6fa fwd="117.96.248.89" dyno=web.1 connect=1ms service=142ms status=400 bytes=199 protocol=https
2017-11-30T13:18:59.628417+00:00 heroku[router]: at=info method=GET path="/" host=sheltered-badlands-75203.herokuapp.com request_id=60c8f313-89cc-4835-a7ec-fb14411991bf fwd="117.96.248.89" dyno=web.1 connect=1ms service=155ms status=400 bytes=199 protocol=https

有人可以帮我弄清楚发生了什么吗?

早些时候我遇到了 gunicorn 没有安装的问题,我已经修复了。一般来说,我是 Django 和 Python 网络开发的新手,所以任何帮助/意见将不胜感激。

编辑:我删除了 :application ,这是新的回溯

2017-11-30T13:47:57.000000+00:00 app[api]: Build started by user namangupta111@gmail.com
2017-11-30T13:48:50.897442+00:00 app[api]: Release v12 created by user namangupta111@gmail.com
2017-11-30T13:48:50.897442+00:00 app[api]: Deploy 423e9204 by user namangupta111@gmail.com
2017-11-30T13:47:57.000000+00:00 app[api]: Build succeeded
2017-11-30T13:48:52.134973+00:00 heroku[web.1]: Restarting
2017-11-30T13:48:52.135624+00:00 heroku[web.1]: State changed from up to starting
2017-11-30T13:48:52.656993+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2017-11-30T13:48:52.668415+00:00 app[web.1]: [2017-11-30 13:48:52 +0000] [8] [INFO] Worker exiting (pid: 8)
2017-11-30T13:48:52.669473+00:00 app[web.1]: [2017-11-30 13:48:52 +0000] [9] [INFO] Worker exiting (pid: 9)
2017-11-30T13:48:52.673590+00:00 app[web.1]: [2017-11-30 13:48:52 +0000] [4] [INFO] Handling signal: term
2017-11-30T13:48:52.875729+00:00 app[web.1]: [2017-11-30 13:48:52 +0000] [4] [INFO] Shutting down: Master
2017-11-30T13:48:53.009653+00:00 heroku[web.1]: Process exited with status 0
2017-11-30T13:49:06.087127+00:00 heroku[web.1]: Starting process with command `gunicorn linky.wsgi --log-file -`
2017-11-30T13:49:09.384527+00:00 app[web.1]: [2017-11-30 13:49:09 +0000] [4] [INFO] Starting gunicorn 19.7.1
2017-11-30T13:49:09.385133+00:00 app[web.1]: [2017-11-30 13:49:09 +0000] [4] [INFO] Listening at: http://0.0.0.0:20627 (4)
2017-11-30T13:49:09.385208+00:00 app[web.1]: [2017-11-30 13:49:09 +0000] [4] [INFO] Using worker: sync
2017-11-30T13:49:09.391750+00:00 app[web.1]: [2017-11-30 13:49:09 +0000] [8] [INFO] Booting worker with pid: 8
2017-11-30T13:49:09.411780+00:00 app[web.1]: [2017-11-30 13:49:09 +0000] [9] [INFO] Booting worker with pid: 9
2017-11-30T13:49:09.708428+00:00 heroku[web.1]: State changed from starting to up
2017-11-30T13:49:12.422864+00:00 heroku[router]: at=info method=GET path="/" host=sheltered-badlands-75203.herokuapp.com request_id=5549dcf5-ce07-4d83-be58-3af8b545c1b1 fwd="117.96.248.89" dyno=web.1 connect=1ms service=945ms status=400 bytes=199 protocol=https

Heroku 部署跟踪

git push heroku master
Counting objects: 7, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (7/7), done.
Writing objects: 100% (7/7), 1.11 KiB | 569.00 KiB/s, done.
Total 7 (delta 4), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: -----> Installing requirements with pip
remote:
remote: -----> Downloading NLTK corpora…
remote:  !     'nltk.txt' not found, not downloading any corpora
remote:  !     Learn more: https://devcenter.heroku.com/articles/python-nltk
remote: -----> Discovering process types
remote:        Procfile declares types -> web
remote:
remote: -----> Compressing...
remote:        Done: 197.1M
remote: -----> Launching...
remote:        Released v14
remote:        https://sheltered-badlands-75203.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy... done.
To https://git.heroku.com/sheltered-badlands-75203.git
97afe3f..f1b8003  master -> master

最佳答案

ALLOWED_HOSTS 中添加您的应用名称或您的自定义域

设置.py

ALLOWED_HOSTS = ['myapp.herokuapp.com']

然后运行

 heroku run python manage.py migrate

关于python - 在 heroku 上部署 Django 应用程序时出现错误请求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47574730/

相关文章:

python - Numpy 将列的特定部分与另一列中的相同部分切换

python - 将平均函数应用于具有外部条件的 MultiIndex 数据帧

git - 将 nodejs 部署到 heroku

ruby-on-rails-3 - amazon-s3 中的 Errno::ENOENT(没有这样的文件或目录)

ruby - 在 Heroku 中的 Puma 上部署 Rails 应用程序时出错

Python - 使用 scrypt 存储密码的正确方法?

python - 如何显示 Seaborn pairplot() 或 PridGrid() 图表的标题

Python Django 相当于 Elixir Ecto 中的预加载

javascript - Django - 未提供身份验证凭据

javascript - Django JavaScript 翻译 gettext 未定义