Python sessions framework

13 views
Skip to first unread message

Kenny Rachuonyo

unread,
Jan 30, 2013, 2:30:48 PM1/30/13
to nai...@googlegroups.com, gdgna...@googlegroups.com
Hello everyone,

Does anyone know a good pure python session framework for storing user session information? 

I need it for an app on Google appengine without that doesn't use the inbuilt users API. I'm using a minimalist web framework, web.py, but the included session framework works with the common DBs such as mysql and postgres. I can extend it to use appengine's datastore but I would also like to try avoid hitting the DB for every session request, and you can't store data on the filesystem on appengine

I've thought of caching the session info using memcached but you lose everything  whenever it is flushed. Is this a good approach?

Martin Chiteri

unread,
Jan 31, 2013, 1:44:32 AM1/31/13
to nai...@googlegroups.com, gdgna...@googlegroups.com
Hello,

You can try beaker http://beaker.readthedocs.org/en/latest/

Never used it personally but have heard praises for it especially from
the WSGI lovers.

Martin.

On 1/30/13, Kenny Rachuonyo <krm...@gmail.com> wrote:
> Hello everyone,
>
> Does anyone know a good pure python session framework for storing user
> session information?
>
> I need it for an app on Google appengine without that doesn't use the
> inbuilt users API. I'm using a minimalist web framework,
> web.py<http://webpy.org/>,
> but the included session framework works with the common DBs such as mysql
> and postgres. I can extend it to use appengine's datastore but I would also
> like to try avoid hitting the DB for every session request, and you can't
> store data on the filesystem on appengine
>
> I've thought of caching the session info using memcached but you lose
> everything whenever it is flushed. Is this a good approach?
> --
> http://keyboardinterrupt.blogspot.com
>
> --
> You received this message because you are subscribed to the Google Groups
> "Nairobi Python Users Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to naipug+un...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

Miano Njoka

unread,
Jan 31, 2013, 2:26:46 AM1/31/13
to nai...@googlegroups.com
Hi Kenny,

You may use cookie-based sessions. Have a look at the implementation in Beaker. It has it's drawbacks, the maximum amount of data you can store in the cookie is 4096 bytes and the larger the cookie is, the slower your site becomes.

However, it's very likely that session tracking will not be the bottleneck in your app, unless it's a really trivial application. Use the most reasonable approach available to you now then profile the application to see what to optimise.

Miano.

--

Anthony Nandaa

unread,
Jan 31, 2013, 5:52:08 AM1/31/13
to nai...@googlegroups.com, GDG Nairobi
Stumbled on this old project - http://gaeutilities.appspot.com see if it could also shade some light just FYI.

---Nandaa
--
-------------------------------------------------------------------------------------------------------
Nandaa Anthony,
Software Architect, Tutor & Mentor.
Google+: http://gplus.to/profnandaa
Blog: www.nandaa.com

Kenny Rachuonyo

unread,
Jan 31, 2013, 6:28:25 AM1/31/13
to nai...@googlegroups.com, GDG Nairobi
Thanks all. I'll try them all out, see what works best.
http://keyboardinterrupt.blogspot.com
Reply all
Reply to author
Forward
0 new messages