I’m trying to make a small testing server for Bugzilla so I can test out changes I make before they are deployed to the main Apache based server. I’m most familiar with Python, and I was wanting to make Python’s built-in HTTP server run Bugzilla’s CGI programs.
Unfortunately, Bugzilla has lots more than CGI apps. It has a bunch of css and other data that is served up directly. This means the handler needs to deal with those as well. I would like to set up a WSGI handler that looks at the request URL and appropriately routes the request to either one of the Bugzilla CGI scripts or pulls the data directly from the filesystem.
Is there a better way to accomplish what I want to do? If there isn’t, is there a WSGI app out there already that will set up a CGI environment and call out to a CGI app via Python’s subprocess module?
Here is a solution that works, though it’s rather ugly and kind of slow. It demands a separate
CGIApplicationobject for each CGI script you want to run. So if you have a directory full of them, you will need to instantiate a differentCGIApplicationobject for each one. When you instantiate it, of course, is up to you. You can choose to instantiate new ones for every request, but you will likely save a bit of time if you somehow avoid this.