On Tue, Apr 14, 2009 at 10:22:08AM +0200, Eric Lemoine wrote:
> I want to use
> 
> [server:main]
> use = egg:Paste#http
> host = 0.0.0.0
> port = 0
> 
> so that my Pylons app's port number is assigned for me.
> 
> Now, from my app's make_app() function do I have a way to know what
> port number has actually been assigned?

I don't think so:

  * the server is not necessarily created/configured when the
    environment calls your make_app

  * you can use the WSGI app with all kinds of servers, not all of which
    are based on TCP/IP (think CGI)

But when you're actually processing a request, you should find the port
number in the WSGI environment (SERVER_PORT, specifically).

Cheers!
Marius Gedminas
-- 
Knowing C++ does tend to be a bit of a handicap, but I think
any competent programmer could learn Python.
        -- Grant Edwards

Attachment: signature.asc
Description: Digital signature

Reply via email to