[WSGI] Tell Python to listen to LAN interface?

Chris Angelico rosuav at gmail.com
Tue Mar 26 08:50:36 EDT 2013


On Tue, Mar 26, 2013 at 11:26 PM, Gilles <nospam at nospam.com> wrote:
> Hello
>
> I'm following this tutorial to learn about writing Python apps in
> WSGI:
>
> http://webpython.codepoint.net/wsgi_tutorial

I'm guessing you're using the initialization code from here?

http://webpython.codepoint.net/wsgi_environment_dictionary

According to the docstring, the first argument to make_server() is the
host name to bind to. Using "localhost" means you're bound to
127.0.0.1, as you see. Use your LAN IP address there, or "" to bind to
all local addresses - or possibly "::" to bind to all IPv6 addresses
(try it and see - some systems work with one or the other, others work
happily with both together).

ChrisA



More information about the Python-list mailing list