Re: A more useful command-line wsgiref.simple_server?

Graham Dumpleton <[email protected]> Mon, 2 Apr 2012 15:08:06 +1000
Newsgroups gmane.comp.python.web
Message-ID <CALRNbkC-Odmq8Ha5jOuS0jYu=FHGixNNbof+m1AGXma0orOn-Q@mail.gmail.com>
On 2 April 2012 14:54, Sasha Hart <[email protected]> wrote:
> I would personally not +x a module file just to serve an app with wsgiref
> from the hashbang line; it's clever but I can't come up with any real
> benefit. A case where I'm serving with wsgiref already has to be pretty
> trivial and I'm not going to couple to it *from inside the module itself*
> when it is so darned easy to just run the module from several nice python
> test servers (also portable and I can use autoreload, etc.) But if this is
> desired by many others, I'd agree it's a good factor to consider.

When using CGI or FASTCGI, with a hosting system where an executable
script needs to be supplied, it is beneficial to be able to say
something like:

  #!/usr/bin/env python -m cgi2wsgi

  #!/usr/bin/env python -m fcgi2wsgi

where the rest of the script is the just the WSGI application.

I have implemented this for CGI as an example at:

  https://github.com/GrahamDumpleton/cgi2wsgi

I have done it for FASTCGI using flup as well before but that isn't
available anywhere.

Graham
_______________________________________________
Web-SIG mailing list
[email protected]
Web SIG: http://www.python.org/sigs/web-sig
Unsubscribe: http://mail.python.org/mailman/options/web-sig/gcpw-web-sig%40m.gmane.org