tags:

views:

141

answers:

3

I'm quite new in Python world. I come from java and ABAP world, where their application server are able to handle stateful request.

Is it also possible in python using WSGI?

Or stateful and stateless are handled in other layer?

+4  A: 

Usually, you don't work with "bare" WSGI. You work with web-frameworks, such as Pylons or TurboGears2.

And these contain a session-middleware, based on WSGI - called "Beaker". But if you work with the framework, you don't have to worry about that - you just use it.

But if you insist, you can of course use Beaker standalone.

deets
+1  A: 

Your question is a little vague and open-ended. First of all, WSGI itself isn't a framework, it's just the glue to connect a framework to the web server. Secondly, I'm not clear on what you mean when you say "state" -- do you mean storing information about a client on the server? If so, web frameworks (Pylons, Django, etc) allow you to store that kind of information in web session variables.

Ken
+2  A: 

I prefer working directly on wsgi, along with mako and psycopg.
It's good to know about Beaker, though I usually don't hold state in the server because I believe it reduces scalability. I either put it in the user's cookie, in the database tied to a token in the user's cookie, or in a redirect url.

thethinman