On 9 Aug 2013, at 8:43 AM, mr...@rethinkrobotics.com wrote: > New to web2py (and python in general) and had a quick question. > > I am writing a bunch of python web services that connect to a remote web > socket. I'd like to treat the IP address of the socket as a global config, > which is accessible by all controllers in the app. > > Is this possible,? and if so where in the source tree would I add > global/static variables like this in? >
If you define it in your model (eg in db.py), it'll be available to your controllers. That is, for example, how your controllers have access to the global variable db. If you can factor out some common code that uses the IP address, you might define that as a function in your model, and have your controllers use that instead of having the IP address directly. -- --- 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.