尝试将Django应用程序部署到Heroku - "内部服务器错误"

时间:2018-04-13 06:40:16

标签: django heroku deployment cookiecutter-django

我一直在尝试部署到Heroku,我必须展示的是一个很大的白页,上面写着"内部服务器错误" (该网站在此处托管:https://iffapp.herokuapp.com/)。

我正在使用django-cookiecutter并严格遵循他们的指南(http://cookiecutter-django.readthedocs.io/en/latest/deployment-on-heroku.html)。一切都很顺利,但没有应用程序。

当我运行heroku run python manage.py check --deploy时,这就是我得到的:

Running python manage.py check --deploy on ⬢ iffapp... up, run.5052 (Hobby)
System check identified no issues (0 silenced).
MacBook-Pro:iffapp Starbuck$ git push heroku master
Counting objects: 5, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (5/5), 442 bytes | 442.00 KiB/s, done.
Total 5 (delta 4), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Python app detected
remote: -----> Installing pip
remote: -----> Installing requirements with pip
remote: 
remote: -----> $ python manage.py collectstatic --noinput
remote:        Found another file with the destination path 'admin/css/changelists.css'. It will be ignored since only the first encountered file is collected. If this is not what you want, make sure every static file has a unique path.
remote:        Found another file with the destination path 'admin/css/fonts.css'. It will be ignored since only the first encountered file is collected. If this is not what you want, make sure every static file has a unique path.
remote:        Found another file with the destination path 'admin/css/widgets.css'. It will be ignored since only the first encountered file is collected. If this is not what you want, make sure every static file has a unique path.
remote:        Found another file with the destination path 'admin/css/login.css'. It will be ignored since only the first encountered file is collected. If this is not what you want, make sure every static file has a unique path.
remote:        Found another file with the destination path 'admin/css/base.css'. It will be ignored since only the first encountered file is collected. If this is not what you want, make sure every static file has a unique path.
remote:        Found another file with the destination path 'admin/css/dashboard.css'. It will be ignored since only the first encountered file is collected. If this is not what you want, make sure every static file has a unique path.
remote:        Found another file with the destination path 'admin/css/rtl.css'. It will be ignored since only the first encountered file is collected. If this is not what you want, make sure every static file has a unique path.
remote:        Found another file with the destination path 'admin/css/forms.css'. It will be ignored since only the first encountered file is collected. If this is not what you want, make sure every static file has a unique path.
remote:        Found another file with the destination path 'admin/js/SelectFilter2.js'. It will be ignored since only the first encountered file is collected. If this is not what you want, make sure every static file has a unique path.
remote:        Found another file with the destination path 'admin/js/admin/RelatedObjectLookups.js'. It will be ignored since only the first encountered file is collected. If this is not what you want, make sure every static file has a unique path.
remote:        Found another file with the destination path 'admin/js/admin/DateTimeShortcuts.js'. It will be ignored since only the first encountered file is collected. If this is not what you want, make sure every static file has a unique path.
remote:        552 static files copied.
remote: 
remote: -----> Discovering process types
remote:        Procfile declares types -> web
remote: 
remote: -----> Compressing...
remote:        Done: 80.1M
remote: -----> Launching...
remote:        Released v26
remote:        https://iffapp.herokuapp.com/ deployed to Heroku
remote: 
remote: Verifying deploy... done.
To heroku.com:iffapp.git
   09052eb..f57712d  master -> master

奇怪的部分是我甚至没有使用那些css和js文件据我所知(它们不在我的实际静态文件夹中)。

该应用程序在我运行Docker的本地环境中完美运行。在我无法在Heroku上工作之后,我放弃了Docker进行生产(因为我的时间很短),但现在整个应用程序都无法正常工作。

我的日志:

2018-04-13T06:02:57.579690+00:00 heroku[run.5052]: State changed from up to complete
2018-04-13T06:03:09.307042+00:00 heroku[run.8338]: Client connection closed. Sending SIGHUP to all processes
2018-04-13T06:03:09.832754+00:00 heroku[run.8338]: Process exited with status 0
2018-04-13T06:03:09.858098+00:00 heroku[run.8338]: State changed from up to complete
2018-04-13T06:03:10.408123+00:00 heroku[router]: at=info method=GET path="/" host=iffapp.herokuapp.com request_id=140bbfa6-a883-4b2e-9157-a8852907d5fb fwd="140.211.16.147" dyno=web.1 connect=1ms service=3ms status=500 bytes=244 protocol=https
2018-04-13T06:01:40+00:00 app[heroku-redis]: source=REDIS sample#active-connections=1 sample#load-avg-1m=0.105 sample#load-avg-5m=0.15 sample#load-avg-15m=0.135 sample#read-iops=0 sample#write-iops=0 sample#memory-total=15664376kB sample#memory-free=12246972kB sample#memory-cached=1379820kB sample#memory-redis=278264bytes sample#hit-rate=0 sample#evicted-keys=0
2018-04-13T06:03:22+00:00 app[heroku-redis]: source=REDIS sample#active-connections=1 sample#load-avg-1m=0.13 sample#load-avg-5m=0.15 sample#load-avg-15m=0.135 sample#read-iops=0 sample#write-iops=0 sample#memory-total=15664376kB sample#memory-free=12246348kB sample#memory-cached=1379824kB sample#memory-redis=278264bytes sample#hit-rate=0 sample#evicted-keys=0
2018-04-13T06:05:06+00:00 app[heroku-redis]: source=REDIS sample#active-connections=1 sample#load-avg-1m=0.13 sample#load-avg-5m=0.16 sample#load-avg-15m=0.14 sample#read-iops=0 sample#write-iops=0 sample#memory-total=15664376kB sample#memory-free=12246564kB sample#memory-cached=1379832kB sample#memory-redis=278264bytes sample#hit-rate=0 sample#evicted-keys=0
2018-04-13T06:06:33+00:00 app[heroku-redis]: source=REDIS sample#active-connections=1 sample#load-avg-1m=0.075 sample#load-avg-5m=0.13 sample#load-avg-15m=0.13 sample#read-iops=0 sample#write-iops=0 sample#memory-total=15664376kB sample#memory-free=12246660kB sample#memory-cached=1379836kB sample#memory-redis=278264bytes sample#hit-rate=0 sample#evicted-keys=0
2018-04-13T06:08:05.856360+00:00 heroku[web.1]: Restarting
2018-04-13T06:08:05.859192+00:00 heroku[web.1]: State changed from up to starting
2018-04-13T06:08:07.195126+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2018-04-13T06:08:07.204099+00:00 app[web.1]: [2018-04-13 06:08:07 +0000] [4] [INFO] Handling signal: term
2018-04-13T06:08:07.505149+00:00 app[web.1]: [2018-04-13 06:08:07 +0000] [4] [INFO] Shutting down: Master
2018-04-13T06:08:07.576189+00:00 heroku[web.1]: Process exited with status 0
2018-04-13T06:08:05.339278+00:00 app[api]: Set DEBUG config vars by user anna@annaspysz.com
2018-04-13T06:08:05.339278+00:00 app[api]: Release v23 created by user anna@annaspysz.com
2018-04-13T06:08:13.862204+00:00 heroku[web.1]: Starting process with command `gunicorn config.wsgi:application`
2018-04-13T06:08:16.765859+00:00 heroku[web.1]: State changed from starting to up
2018-04-13T06:08:16.457011+00:00 app[web.1]: [2018-04-13 06:08:16 +0000] [4] [INFO] Starting gunicorn 19.7.1
2018-04-13T06:08:16.457844+00:00 app[web.1]: [2018-04-13 06:08:16 +0000] [4] [INFO] Listening at: http://0.0.0.0:12574 (4)
2018-04-13T06:08:16.458017+00:00 app[web.1]: [2018-04-13 06:08:16 +0000] [4] [INFO] Using worker: sync
2018-04-13T06:08:16.464087+00:00 app[web.1]: [2018-04-13 06:08:16 +0000] [8] [INFO] Booting worker with pid: 8
2018-04-13T06:08:16.521508+00:00 app[web.1]: [2018-04-13 06:08:16 +0000] [9] [INFO] Booting worker with pid: 9
2018-04-13T06:08:16.559294+00:00 app[web.1]: [2018-04-13 06:08:16 +0000] [10] [INFO] Booting worker with pid: 10
2018-04-13T06:08:16.664980+00:00 app[web.1]: [2018-04-13 06:08:16 +0000] [13] [INFO] Booting worker with pid: 13
2018-04-13T06:08:18.420503+00:00 heroku[router]: at=info method=GET path="/" host=iffapp.herokuapp.com request_id=d5e9706c-eebe-4a8c-bbef-76c6507f82f8 fwd="140.211.16.147" dyno=web.1 connect=0ms service=4ms status=500 bytes=244 protocol=https
2018-04-13T06:08:45.207502+00:00 heroku[router]: at=info method=GET path="/" host=iffapp.herokuapp.com request_id=741701da-7c5d-43c2-ac43-2a160afef8d6 fwd="140.211.16.147" dyno=web.1 connect=1ms service=3ms status=500 bytes=244 protocol=https
2018-04-13T06:08:09+00:00 app[heroku-redis]: source=REDIS sample#active-connections=1 sample#load-avg-1m=0.025 sample#load-avg-5m=0.105 sample#load-avg-15m=0.12 sample#read-iops=0 sample#write-iops=0 sample#memory-total=15664376kB sample#memory-free=12246468kB sample#memory-cached=1379748kB sample#memory-redis=278264bytes sample#hit-rate=0 sample#evicted-keys=0
2018-04-13T06:09:43+00:00 app[heroku-redis]: source=REDIS sample#active-connections=1 sample#load-avg-1m=0.05 sample#load-avg-5m=0.1 sample#load-avg-15m=0.12 sample#read-iops=0 sample#write-iops=0 sample#memory-total=15664376kB sample#memory-free=12245804kB sample#memory-cached=1379968kB sample#memory-redis=278264bytes sample#hit-rate=0 sample#evicted-keys=0
2018-04-13T06:10:44.249967+00:00 app[api]: Release v24 created by user anna@annaspysz.com
2018-04-13T06:10:44.249967+00:00 app[api]: Set DOMAIN_NAME config vars by user anna@annaspysz.com
2018-04-13T06:10:44.756790+00:00 heroku[web.1]: Restarting
2018-04-13T06:10:44.758789+00:00 heroku[web.1]: State changed from up to starting
2018-04-13T06:10:45.692865+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2018-04-13T06:10:45.751113+00:00 app[web.1]: [2018-04-13 06:10:45 +0000] [4] [INFO] Handling signal: term
2018-04-13T06:10:46.183126+00:00 app[web.1]: [2018-04-13 06:10:46 +0000] [4] [INFO] Shutting down: Master
2018-04-13T06:10:46.419280+00:00 heroku[web.1]: Process exited with status 0
2018-04-13T06:10:50.487455+00:00 heroku[web.1]: Starting process with command `gunicorn config.wsgi:application`
2018-04-13T06:10:52.251300+00:00 app[web.1]: [2018-04-13 06:10:52 +0000] [4] [INFO] Starting gunicorn 19.7.1
2018-04-13T06:10:52.251839+00:00 app[web.1]: [2018-04-13 06:10:52 +0000] [4] [INFO] Listening at: http://0.0.0.0:20702 (4)
2018-04-13T06:10:52.251927+00:00 app[web.1]: [2018-04-13 06:10:52 +0000] [4] [INFO] Using worker: sync
2018-04-13T06:10:52.256048+00:00 app[web.1]: [2018-04-13 06:10:52 +0000] [8] [INFO] Booting worker with pid: 8
2018-04-13T06:10:52.323297+00:00 app[web.1]: [2018-04-13 06:10:52 +0000] [9] [INFO] Booting worker with pid: 9
2018-04-13T06:10:52.385570+00:00 app[web.1]: [2018-04-13 06:10:52 +0000] [11] [INFO] Booting worker with pid: 11
2018-04-13T06:10:52.403622+00:00 app[web.1]: [2018-04-13 06:10:52 +0000] [13] [INFO] Booting worker with pid: 13
2018-04-13T06:10:52.637146+00:00 heroku[web.1]: State changed from starting to up
2018-04-13T06:11:07.318267+00:00 heroku[web.1]: Restarting
2018-04-13T06:11:07.321809+00:00 heroku[web.1]: State changed from up to starting
2018-04-13T06:11:08.022434+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2018-04-13T06:11:08.030618+00:00 app[web.1]: [2018-04-13 06:11:08 +0000] [4] [INFO] Handling signal: term
2018-04-13T06:11:08.231496+00:00 app[web.1]: [2018-04-13 06:11:08 +0000] [4] [INFO] Shutting down: Master
2018-04-13T06:11:08.306434+00:00 heroku[web.1]: Process exited with status 0
2018-04-13T06:11:06.926456+00:00 app[api]: Release v25 created by user anna@annaspysz.com
2018-04-13T06:11:06.926456+00:00 app[api]: Set DJANGO_ALLOWED_HOSTS config vars by user anna@annaspysz.com
2018-04-13T06:11:16.177198+00:00 heroku[web.1]: Starting process with command `gunicorn config.wsgi:application`
2018-04-13T06:11:18.780869+00:00 app[web.1]: [2018-04-13 06:11:18 +0000] [4] [INFO] Starting gunicorn 19.7.1
2018-04-13T06:11:18.781505+00:00 app[web.1]: [2018-04-13 06:11:18 +0000] [4] [INFO] Listening at: http://0.0.0.0:15279 (4)
2018-04-13T06:11:18.781608+00:00 app[web.1]: [2018-04-13 06:11:18 +0000] [4] [INFO] Using worker: sync
2018-04-13T06:11:18.785545+00:00 app[web.1]: [2018-04-13 06:11:18 +0000] [8] [INFO] Booting worker with pid: 8
2018-04-13T06:11:18.830350+00:00 app[web.1]: [2018-04-13 06:11:18 +0000] [9] [INFO] Booting worker with pid: 9
2018-04-13T06:11:18.901728+00:00 app[web.1]: [2018-04-13 06:11:18 +0000] [11] [INFO] Booting worker with pid: 11
2018-04-13T06:11:18.959232+00:00 app[web.1]: [2018-04-13 06:11:18 +0000] [13] [INFO] Booting worker with pid: 13
2018-04-13T06:11:19.986668+00:00 heroku[web.1]: State changed from starting to up
2018-04-13T06:11:19+00:00 app[heroku-redis]: source=REDIS sample#active-connections=1 sample#load-avg-1m=0.175 sample#load-avg-5m=0.135 sample#load-avg-15m=0.13 sample#read-iops=0 sample#write-iops=0 sample#memory-total=15664376kB sample#memory-free=12245476kB sample#memory-cached=1379968kB sample#memory-redis=278264bytes sample#hit-rate=0 sample#evicted-keys=0
2018-04-13T06:13:11.816544+00:00 heroku[router]: at=info method=GET path="/" host=iffapp.herokuapp.com request_id=edbed58f-b9bd-41df-ad2d-f425e4aa34b6 fwd="140.211.16.147" dyno=web.1 connect=0ms service=3ms status=500 bytes=244 protocol=https
2018-04-13T06:12:52+00:00 app[heroku-redis]: source=REDIS sample#active-connections=1 sample#load-avg-1m=0.19 sample#load-avg-5m=0.14 sample#load-avg-15m=0.13 sample#read-iops=0 sample#write-iops=0 sample#memory-total=15664376kB sample#memory-free=12245572kB sample#memory-cached=1379968kB sample#memory-redis=278264bytes sample#hit-rate=0 sample#evicted-keys=0
2018-04-13T06:14:29+00:00 app[heroku-redis]: source=REDIS sample#active-connections=1 sample#load-avg-1m=0.17 sample#load-avg-5m=0.135 sample#load-avg-15m=0.13 sample#read-iops=0 sample#write-iops=0 sample#memory-total=15664376kB sample#memory-free=12245664kB sample#memory-cached=1379972kB sample#memory-redis=278264bytes sample#hit-rate=0 sample#evicted-keys=0
2018-04-13T06:15:25.811402+00:00 heroku[router]: at=info method=GET path="/" host=iffapp.herokuapp.com request_id=f15938c1-a28c-4698-ab45-fecd359779a1 fwd="140.211.16.147" dyno=web.1 connect=1ms service=4ms status=500 bytes=244 protocol=https
2018-04-13T06:14:29+00:00 app[heroku-redis]: source=REDIS sample#active-connections=1 sample#load-avg-1m=0.1 sample#load-avg-5m=0.13 sample#load-avg-15m=0.13 sample#read-iops=0 sample#write-iops=0 sample#memory-total=15664376kB sample#memory-free=12242448kB sample#memory-cached=1380268kB sample#memory-redis=278264bytes sample#hit-rate=0 sample#evicted-keys=0
2018-04-13T06:16:05+00:00 app[heroku-redis]: source=REDIS sample#active-connections=1 sample#load-avg-1m=0.12 sample#load-avg-5m=0.135 sample#load-avg-15m=0.135 sample#read-iops=0 sample#write-iops=0 sample#memory-total=15664376kB sample#memory-free=12242688kB sample#memory-cached=1380272kB sample#memory-redis=278264bytes sample#hit-rate=0 sample#evicted-keys=0
2018-04-13T06:17:46.000000+00:00 app[api]: Build started by user anna@annaspysz.com
2018-04-13T06:18:46.444016+00:00 heroku[web.1]: Restarting
2018-04-13T06:18:46.444016+00:00 heroku[web.1]: State changed from up to starting
2018-04-13T06:18:47.315948+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2018-04-13T06:18:47.351232+00:00 app[web.1]: [2018-04-13 06:18:47 +0000] [4] [INFO] Handling signal: term
2018-04-13T06:18:47.557011+00:00 app[web.1]: [2018-04-13 06:18:47 +0000] [4] [INFO] Shutting down: Master
2018-04-13T06:18:47.728920+00:00 heroku[web.1]: Process exited with status 0
2018-04-13T06:18:53.010022+00:00 heroku[web.1]: Starting process with command `gunicorn config.wsgi:application`
2018-04-13T06:17:44+00:00 app[heroku-redis]: source=REDIS sample#active-connections=1 sample#load-avg-1m=0.175 sample#load-avg-5m=0.145 sample#load-avg-15m=0.135 sample#read-iops=0 sample#write-iops=0 sample#memory-total=15664376kB sample#memory-free=12243148kB sample#memory-cached=1380184kB sample#memory-redis=278264bytes sample#hit-rate=0 sample#evicted-keys=0
2018-04-13T06:18:45.881932+00:00 app[api]: Deploy f57712dd by user anna@annaspysz.com
2018-04-13T06:18:45.881932+00:00 app[api]: Release v26 created by user anna@annaspysz.com
2018-04-13T06:17:46.000000+00:00 app[api]: Build succeeded
2018-04-13T06:18:54.960345+00:00 app[web.1]: [2018-04-13 06:18:54 +0000] [4] [INFO] Starting gunicorn 19.7.1
2018-04-13T06:18:54.960885+00:00 app[web.1]: [2018-04-13 06:18:54 +0000] [4] [INFO] Listening at: http://0.0.0.0:24866 (4)
2018-04-13T06:18:54.960998+00:00 app[web.1]: [2018-04-13 06:18:54 +0000] [4] [INFO] Using worker: sync
2018-04-13T06:18:54.964810+00:00 app[web.1]: [2018-04-13 06:18:54 +0000] [8] [INFO] Booting worker with pid: 8
2018-04-13T06:18:55.039791+00:00 app[web.1]: [2018-04-13 06:18:55 +0000] [10] [INFO] Booting worker with pid: 10
2018-04-13T06:18:55.077575+00:00 app[web.1]: [2018-04-13 06:18:55 +0000] [11] [INFO] Booting worker with pid: 11
2018-04-13T06:18:55.142747+00:00 app[web.1]: [2018-04-13 06:18:55 +0000] [13] [INFO] Booting worker with pid: 13
2018-04-13T06:18:56.629671+00:00 heroku[web.1]: State changed from starting to up
2018-04-13T06:19:56.853253+00:00 heroku[router]: at=info method=GET path="/" host=iffapp.herokuapp.com request_id=f2a58f3d-8221-4a38-ab7a-1d047ccfeb5e fwd="140.211.16.147" dyno=web.1 connect=1ms service=4ms status=500 bytes=244 protocol=https
2018-04-13T06:19:22+00:00 app[heroku-redis]: source=REDIS sample#active-connections=1 sample#load-avg-1m=0.255 sample#load-avg-5m=0.165 sample#load-avg-15m=0.145 sample#read-iops=0 sample#write-iops=0 sample#memory-total=15664376kB sample#memory-free=12243148kB sample#memory-cached=1380184kB sample#memory-redis=278264bytes sample#hit-rate=0 sample#evicted-keys=0
2018-04-13T06:20:55+00:00 app[heroku-redis]: source=REDIS sample#active-connections=1 sample#load-avg-1m=0.19 sample#load-avg-5m=0.175 sample#load-avg-15m=0.15 sample#read-iops=0 sample#write-iops=0 sample#memory-total=15664376kB sample#memory-free=12243664kB sample#memory-cached=1380184kB sample#memory-redis=278264bytes sample#hit-rate=0 sample#evicted-keys=0
2018-04-13T06:22:36+00:00 app[heroku-redis]: source=REDIS sample#active-connections=1 sample#load-avg-1m=0.18 sample#load-avg-5m=0.18 sample#load-avg-15m=0.15 sample#read-iops=0 sample#write-iops=0 sample#memory-total=15664376kB sample#memory-free=12243796kB sample#memory-cached=1380184kB sample#memory-redis=278264bytes sample#hit-rate=0 sample#evicted-keys=0
2018-04-13T06:22:36+00:00 app[heroku-redis]: source=REDIS sample#active-connections=1 sample#load-avg-1m=0.215 sample#load-avg-5m=0.19 sample#load-avg-15m=0.155 sample#read-iops=0 sample#write-iops=0 sample#memory-total=15664376kB sample#memory-free=12243012kB sample#memory-cached=1380308kB sample#memory-redis=278264bytes sample#hit-rate=0 sample#evicted-keys=0
2018-04-13T06:24:14+00:00 app[heroku-redis]: source=REDIS sample#active-connections=1 sample#load-avg-1m=0.165 sample#load-avg-5m=0.19 sample#load-avg-15m=0.16 sample#read-iops=0 sample#write-iops=0 sample#memory-total=15664376kB sample#memory-free=12263456kB sample#memory-cached=1380276kB sample#memory-redis=278264bytes sample#hit-rate=0 sample#evicted-keys=0
2018-04-13T06:25:46+00:00 app[heroku-redis]: source=REDIS sample#active-connections=1 sample#load-avg-1m=0.105 sample#load-avg-5m=0.175 sample#load-avg-15m=0.155 sample#read-iops=0 sample#write-iops=0 sample#memory-total=15664376kB sample#memory-free=12263732kB sample#memory-cached=1380280kB sample#memory-redis=278264bytes sample#hit-rate=0 sample#evicted-keys=0
2018-04-13T06:27:19+00:00 app[heroku-redis]: source=REDIS sample#active-connections=1 sample#load-avg-1m=0.14 sample#load-avg-5m=0.175 sample#load-avg-15m=0.16 sample#read-iops=0 sample#write-iops=0 sample#memory-total=15664376kB sample#memory-free=12263336kB sample#memory-cached=1380284kB sample#memory-redis=278392bytes sample#hit-rate=0 sample#evicted-keys=0
2018-04-13T06:28:50+00:00 app[heroku-redis]: source=REDIS sample#active-connections=1 sample#load-avg-1m=0.185 sample#load-avg-5m=0.185 sample#load-avg-15m=0.16 sample#read-iops=0 sample#write-iops=0 sample#memory-total=15664376kB sample#memory-free=12263664kB sample#memory-cached=1380452kB sample#memory-redis=278392bytes sample#hit-rate=0 sample#evicted-keys=0

这是我第一次部署Django应用程序并且第一次使用cookiecutter,所以任何帮助都将非常感谢!

编辑:这些是我通过电子邮件收到的错误:

KeyError: 'DJANGO_ADMIN_URL'
  File "environ/environ.py", line 271, in get_value
    value = self.ENVIRON[var]
  File "python3.6/os.py", line 669, in __getitem__
    raise KeyError(key) from None

ImproperlyConfigured: Set the DJANGO_ADMIN_URL environment variable
(16 additional frame(s) were not displayed)
...
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "config/settings/production.py", line 129, in <module>
    ADMIN_URL = env('DJANGO_ADMIN_URL')
  File "environ/environ.py", line 130, in __call__
    return self.get_value(var, cast=cast, default=default, parse_default=parse_default)
  File "environ/environ.py", line 275, in get_value
    raise ImproperlyConfigured(error_msg)

消息

ImproperlyConfigured: Set the DJANGO_ADMIN_URL environment variable
Tags

level = fatal  server_name = 4864daa9-e8cb-467a-b073-2af971594aae site = 1

在本地运行应用程序时,我使用的是.envs文件,我无法上传到Heroku。但是,我确实在Heroku应用程序设置配置中配置了设置。

编辑2 :为了确定,我在基本设置中添加了django-herokudjango_heroku.settings(locals())。仍然没有运气。

1 个答案:

答案 0 :(得分:0)

也许设置DEBUG = True一秒钟,以便在heroku网站上查看回复。

在Heroku配置中将管理员URL设置为DJANGO_ADMIN_URL = r'^ secretadmin /'。