gpt4 book ai didi

django - Heroku Django-Admin 500 错误?

转载 作者:行者123 更新时间:2023-12-04 23:55:09 28 4
gpt4 key购买 nike

将一个新应用程序部署到 Heroku 应用程序,该应用程序在 myapp.herokuapp.com 上运行良好,但如果我尝试访问 myapp.herokuapp.com/admin 上的管理后端,则会引发 500 服务器错误

INSTALLED_APPS = (
...
'django.contrib.admin',
'gunicorn',
'storages',
# 'django.contrib.admindocs',

)

这是日志摘录:
2013-07-10T17:35:28.893320+00:00 heroku[web.1]: Starting process with command `python manage.py run_gunicorn -b 0.0.0.0:27294 -w 3 --log-level info`
2013-07-10T17:35:32.298226+00:00 app[web.1]: 2013-07-10 13:35:32 [2] [INFO] Starting gunicorn 0.17.4
2013-07-10T17:35:32.299005+00:00 app[web.1]: 2013-07-10 13:35:32 [2] [INFO] Using worker: sync
2013-07-10T17:35:32.298932+00:00 app[web.1]: 2013-07-10 13:35:32 [2] [INFO] Listening at: http://0.0.0.0:27294 (2)
2013-07-10T17:35:32.312781+00:00 app[web.1]: 2013-07-10 13:35:32 [11] [INFO] Booting worker with pid: 11
2013-07-10T17:35:32.388874+00:00 app[web.1]: 2013-07-10 13:35:32 [12] [INFO] Booting worker with pid: 12
2013-07-10T17:35:32.495370+00:00 heroku[web.1]: State changed from starting to up
2013-07-10T17:35:32.524196+00:00 app[web.1]: 2013-07-10 13:35:32 [13] [INFO] Booting worker with pid: 13
2013-07-10T17:35:59.929850+00:00 heroku[router]: at=info method=GET path=/ host=myapp.herokuapp.com fwd="64.119.130.116" dyno=web.1 connect=0ms service=190ms status=200 bytes=12220
2013-07-10T17:36:04.363323+00:00 heroku[router]: at=info method=GET path=/admin host=myapp.herokuapp.com fwd="64.119.130.116" dyno=web.1 connect=0ms service=4ms status=301 bytes=5
2013-07-10T17:36:04.872523+00:00 heroku[router]: at=info method=GET path=/admin/ host=myapp.herokuapp.com fwd="64.119.130.116" dyno=web.1 connect=0ms service=481ms status=500 bytes=38

哪些设置会导致应用程序正常运行但在/admin 上引发 500 错误?我可能忽略或遗漏了什么?谢谢。

最佳答案

感谢 Magnus 的推荐,我在我的项目中添加了哨兵,并发现了一个 postgres DatabaseError:relation issue 由于我没有在 heroku 上成功迁移的项目应用程序。

修复只是做了一个假的并完成了迁移的其余部分。

heroku run python manage.py migrate app 0016 --fake
heroku run python manage.py migrate

关于django - Heroku Django-Admin 500 错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17577360/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com