This module requires you to add the ndb
package to your app. See NDB.
webapp2_extras.appengine.sessions_ndb.
DatastoreSessionFactory
(name, session_store)[source]¶A session factory that stores data serialized in datastore.
To use datastore sessions, pass this class as the factory keyword to
webapp2_extras.sessions.SessionStore.get_session()
:
from webapp2_extras import sessions_ndb
# [...]
session = self.session_store.get_session(
name='db_session', factory=sessions_ndb.DatastoreSessionFactory)
See in webapp2_extras.sessions.SessionStore()
an example of how to
make sessions available in a webapp2.RequestHandler
.
session_model
¶The session model class.