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

RavenDB vs MongoDB: Which is Better? This White Paper compares the two leading NoSQL Document Databases on 9 features to find out which is the best solution for your next project.  

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 

Get comfortable using NoSQL in a free, self-directed learning course provided by RavenDB. Learn to create fully-functional real-world programs on NoSQL Databases. Register today.

Topics:

Opinions expressed by DZone contributors are their own.

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

{{ parent.tldr }}

{{ parent.urlSource.name }}