I don't want a class created on each request, I want to get environ
when initializing my application. For example:
if environ['SERVER_ADDR']=='127.0.0.1': # If localhost, add a Dev menu
These values would stay the same throughout my session. Now how can I
get these values in __init__? Is there
On Thu, 20 Oct 2011 17:21:37 +0300, Gnarlodious gnarlodi...@gmail.com
wrote:
I don't want a class created on each request, I want to get environ
when initializing my application. For example:
if environ['SERVER_ADDR']=='127.0.0.1': # If localhost, add a Dev menu
These values would stay the
Correct.
The WSGI specification doesn't cover any way of providing application
initialisation information. You will need to provide that manually
somehow and no way it can be passed in automatically.
Graham
On 21 October 2011 01:35, Joonas Lehtolahti godjo...@gmail.com wrote:
On Thu, 20 Oct
class Tester(object):
def __init__(self):
self.environ=environ
def __call__(self, environ, startResponse):
startResponse(200 OK, [(Content-Type, text/plain)])
ApplicationName=self.environ['mod_wsgi.process_group']
So... instead of __call__ I should use __iter__, which must return at
least one yield string.
That clarifies it, I think. I'll experiment with it over the next few
days.
-- Gnarlie
http://Gnarlodious.com
--
You received this message because you are subscribed to the Google Groups
modwsgi
The original document you referenced has three examples of how to have
a class created on each request with environ captured in constructor.
Look for those examples where it uses:
application = Application
Graham
On 20 October 2011 05:36, Gnarlodious gnarlodi...@gmail.com wrote:
So...