How to debug Django exceptions in OpenShift applications

独自空忆成欢 提交于 2019-12-11 08:54:41

问题


Background:

I am deploying a django application with Python 2.7.5 && Django 1.6. Currently I am able to render all pages, but one.

The only error I am able to see when tailing the logs is:

"GET /test/ HTTP/1.1" 500 2011 "http://myPrivateApp.rhcloud.com/myPrivatePage/" Obviously this log message doesn't tell me much other than it failed and I cannot find any django related logs within the repos.

After playing around with the other pages, I highly suspect the issue is related to an exception being thrown within the page.

Question:

How can I debug Django exception errors on OpenShift? Is it possible to step through executing code in Openshift via ssh && the use of a debugger app such as ipdb?

I would really like to dig deeper into the issue, but am not finding any clear way to do so with OpenShift.


回答1:


On Openshift, you can type this command :

   rhc tail -a <app-name> 

and get the traceback . It should tell you what went wrong




回答2:


I strongly advocate to use Sentry ( https://getsentry.com/welcome/ ) for such debugging. It just made our lives easier. You can see all the details reported and the same errors are grouped together.

Additionally you can SSH into Openshift and use the common Linux tools or to use rhc tail as mentioned.



来源:https://stackoverflow.com/questions/20586363/how-to-debug-django-exceptions-in-openshift-applications

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!