Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Server-side Sessions With Redis Using Flask

DZone's Guide to

Server-side Sessions With Redis Using Flask

· Database Zone
Free Resource

Learn how our document data model can map directly to how you program your app, and native database features like secondary indexes, geospatial and text search give you full access to your data. Brought to you in partnership with MongoDB.

It's clear that session storage is a super-popular use case for the Redis NoSQL data store.  I found another example this week by Armin Ronacher who writes about his coding excursions with the Flask Python micro framework.  

Check out his code, described here, for the Redis session interface classes:

The following code implements a session backend using redis. It allows you to either pass in a redis client or will connect to the redis instance on localhost. All the keys are prefixed with a specified prefix which defaults to session:

-- Armin Ronacher 

Discover when your data grows or your application performance demands increase, MongoDB Atlas allows you to scale out your deployment with an automated sharding process that ensures zero application downtime. Brought to you in partnership with MongoDB.

Topics:

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}