Quantcast
Channel: Admins Goodies » cherrypy
Viewing all articles
Browse latest Browse all 5

CherryPy 3 with Apache 2 using ModWSGI: stack traces?

$
0
0

Question

I am trying to show stack traces or at least some sort of errors rendered to the HTML response while using a WSGI script. A ModuleNotFound exception is raised when I tried to import a module the script can’t seem to find (which is fine for now), but all that is reported in the HTTP response is a rather vague Internal Server Error status 500 error which looks like Apache’s work.

How can I get a stack trace to show up?

Other information: I’m using Windows Server for this with Apache 2.2 (standalone, non-WAMP) as a service and CherryPy 3.2.2. I am using another machine on the same local network to edit the script through network sharing; I am unfamiliar with remote WSGI debugging, but if someone knows how to debug this without having to rely on apache’s error logs, I’d love some suggestions. I’ve tried lots of configuration options for CherryPy to no avail, so I’d love to hear if anyone is familiar with exactly this.

Please let me know if you have any ideas; thanks!

Asked by Apelsin

Answer

It was as simple as cleverly wrapping everything in a big try/except and including modules inside of the main reply function (yucky) and replying with a string formatted version of an exception.

Needless to say I ultimately ended up making a Django project for this (probably for the best).

Django gets the job done and then some.

Answered by Apelsin

Viewing all articles
Browse latest Browse all 5

Trending Articles