How to test a WSGI application using a script?

I am debugging a really strange problem with the application deployed by mod_wsgi, as a result of which Django / Apache (still unknown which) gave the status of 500 errors to some users instead of the correct 404. I want to exclude Apache from the debugging environment to determine which part of the installation is damaged, and send my requests manually to the WSGI handler.

I suspect this is as simple as setting up the environment and running python wsgi_handler.py , but is this correct? What is necessary for the environment? Any pointers to existing documentation?

+4
source share
1 answer

it's as simple as setting up the environment and running python wsgi_handler.py,

Right.

What is necessary for the environment? Any pointers to existing documentation?

Have you read this? http://docs.python.org/library/wsgiref.html

You can easily start the web server from your desktop for testing. These are very few lines of code.

http://docs.python.org/library/wsgiref.html#wsgiref.simple_server.make_server

+3
source

All Articles