[Web-SIG] A more useful command-line wsgiref.simple_server?

Masklinn masklinn at masklinn.net
Fri Mar 30 22:09:12 CEST 2012


On 2012-03-30, at 21:58 , Geoffrey Spear wrote:
> On Fri, Mar 30, 2012 at 3:20 PM, Masklinn <masklinn at masklinn.net> wrote:
>> 2. You seem to have asserted from the start that the default should be
>>   mounting modules, but I have seen no evidence or argument in favor of
>>   that so far.
>> 
>>   Defaulting to scripts not only works with both local modules and
>>   arbitrary files and follow cpython's (and most tools's) own behavior,
>>   but would also allows using -mwsgiref.simple_server as a shebang
>>   line. I find this to have quite a lot of value.
> 
> I may be dense, but is there actually a use case for using a WSGI
> application from a script? Presumably a script that defines a WSGI
> application would also run it.

I would recommend going back to the original email of the thread
where I described precisely the issue I have with this. And of course
you could have the exact same objection about a module.

The point is very much not to need the overhead of defining a
(conditional) import and usage of simple_server, and keep the
script/module itself focused on its job of defining the application.

It also frees up the __main__ runner for other behaviors such as
testing or CLI tools if needs be.


More information about the Web-SIG mailing list