How do you diagnose a 500 error on Heroku when there is no error message in the logs?

后端 未结 3 711
臣服心动
臣服心动 2020-12-10 00:59

I have a Rails app on Heroku that is serving 500 errors at random intervals. Web pages will display \"Internal server error\" in plain text, instead of the usual \"We\'re so

3条回答
  •  长情又很酷
    2020-12-10 01:25

    The solution that worked for me when deploying my Django apps to Heroku is to go into the production.py file and change the code DEBUG = FALSE to DEBUG = TRUE. In this way, you should be able to see the errors that Django displays. Be aware that once you have found the error and have done the corrections, this setting must be changed back to FALSE.

    In case changing to TRUE shows the app to work but the error is not visible then check your forms.py file and make sure that your models do not have any inconsistency. In my previous cases, the forms.py file has been the culprit.

提交回复
热议问题