Skip to main content

Pyramid web framework session factory backed by Redis

Project description

pyramid_redis_sessions gives you Redis-backed sessions for the Pyramid Web Application Development Framework.

The package implements the Pyramid ISession interface (http://docs.pylonsproject.org/projects/pyramid/en/latest/api/interfaces.html#pyramid.interfaces.ISession), and that portion of the API will not change. However, any other implementation-specific methods on the RedisSession object are subject to change.

Patches and feature requests are welcome.

Usage:

  • $ easy_install pyramid_redis_sessions

  • In your Pyramid config file (typically development.ini or production.ini), configure the settings (see below)

  • In your Pyramid application main function, use either:

    • pyramid.include(‘pyramid_redis_sessions’)

  • Or:

    • from pyramid_redis_sessions import session_factory_from_settings

    • session_factory = session_factory_from_settings(settings)

    • config.set_session_factory(session_factory)

You can configure the following settings in your ini file:

  • redis.sessions.secret = your_secret

  • redis.sessions.timeout = 1200

  • redis.sessions.period = 300

  • redis.sessions.cookie_name = session

  • redis.sessions.cookie_max_age =

  • redis.sessions.cookie_path = /

  • redis.sessions.cookie_domain =

  • redis.sessions.cookie_secure = False

  • redis.sessions.cookie_httponly = False

  • redis.sessions.cookie_on_exception = True

  • redis.sessions.host = localhost

  • redis.sessions.port = 6379

  • redis.sessions.db = 0

  • redis.sessions.password = None

  • redis.sessions.socket_timeout =

  • redis.sessions.connection_pool =

  • redis.sessions.charset = utf-8

  • redis.sessions.errors = strict

  • redis.sessions.unix_socket_path =

Only redis.sessions.secret is required. All other parameters have sensible defaults.

Note: package assumes you have a running Redis instance at the specified host and port.

Changelog

-Initial Release

-09/24/2012: 0.9 beta release

-11/12/2012: raise ConfigurationError if required redis.sessions.secret setting

is missing.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyramid_redis_sessions-0.9b2.tar.gz (10.4 kB view details)

Uploaded Source

File details

Details for the file pyramid_redis_sessions-0.9b2.tar.gz.

File metadata

File hashes

Hashes for pyramid_redis_sessions-0.9b2.tar.gz
Algorithm Hash digest
SHA256 0b9271c7438e3a568b21b241c7550b509d148706f43a7a1a06066d1914359d3a
MD5 c75e554bdcc706b3d865b87f2cb1b290
BLAKE2b-256 2f75cd5d1b17493f4132e67d80d98c30efeddbaa7071f6c1550800be1ee38325

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page