mercredi 4 janvier 2017

"ServletContext" similar thing in Python WSGI?

protected void processRequest(HttpServletRequest request, HttpServletResponse response){ ServletContext ctx = getServletContext(); if (ctx.getAttribute("appData") != null) { String data = (String) ctx.getAttribute("appData"); ctx.setAttribute("appData","updated value"); } }

This "appData" in ServletContext attribute is accessible and modifiable by any user of this system.

I want do something like that in Python WSGI. Please give me suggestion.

def application(environ, start_response):
 if environ['PATH_INFO'] == '/my-web-url':
   # want to do similar logic of above in here

Aucun commentaire:

Enregistrer un commentaire