thanks Leonel and Michael.

forgot to tell there are 2 programs running at least on one of those servers, a web2py application and another application polling a solar system.
So I don't always have the request variable.

So I hoped I could use os.curdir, but for some unknown reason that doesn't work correctly. Instead I now use platform.uname () which is unique enough (although on PythonAnyWhere the name of the server is not constant)

cheers,
Stef


On 30-05-14 14:24, Michael Beller wrote:
Depending on your server and hosting environment, request.env.http_host may always return '127.0.0.1:8000' when you're using the browser based shell (in admin) or running web2py from console.

I found it was more reliable to use request.env.web2py_path which always gave a unique path (in the browser shell, while running web2py from the shell, and normally) for the server environment. I use this to detect my dev, test, or prod environment.
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected] <mailto:[email protected]>.
For more options, visit https://groups.google.com/d/optout.

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- You received this message because you are subscribed to the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to