[Flask] Jeff Levesque: integrating redis with flask session

Jeffrey Levesque jeff1evesque at yahoo.com
Sat Jan 14 10:27:46 EST 2017


It's hard to summarize so much background.  My application has an automated build via vagrant for local development.  This vagrant environment works as intended on the chrome browser:

- https://github.com/jeff1evesque/machine-learning/pull/2867#issuecomment-272431783

The docker environment (currently) is for automated unit tests, handled by Travis CI.  But, the build is failing with redis, when integrated with the flask session:

- https://travis-ci.org/jeff1evesque/machine-learning/builds/191619024#L3803

I spoke to @notdaniel in #pocoo, and he's been really helpful.  He helped me with the working vagrant environment.  But, last night he told me to try to explicitly define redis strict session, similar to the way my application uses it, in other places.

My application uses redis in other contexts, like generating model, then serializing it into redis, so it can be used for future predictions, when queried from redis, the. unserialized.  I have unit tests that have been integrated into Travis CI, which tests this.  This feature has been in place for some time, so I know redis works within my application for other needs.


Thank you,

Jeff Levesque
https://github.com/jeff1evesque

> On Jan 14, 2017, at 9:33 AM, Anthony Ford <ford.anthonyj at gmail.com> wrote:
> 
> Have you checked the offical Flask plugin, Flask-Session?
> 
> It has support for Redis, among other backends. Can be found here: https://pythonhosted.org/Flask-Session/
> 
> That being said, have you tested the redis server outside your application? Are you sure you can connect to it?
> 
> Anthony Ford,
> KF5IBN,
> ford.anthonyj at gmail.com
> 
>> On Fri, Jan 13, 2017 at 11:55 PM, Jeffrey Levesque via Flask <flask at python.org> wrote:
>> Hi All,
>> 
>> I'm trying to integrate redis with flask's session. My motivation are redis being more secure than the standard cookie implementation, and slightly better overall performance.
>> 
>> I posted an issue on flasks official github repository, regarding the exact details:
>> 
>> - https://github.com/pallets/flask/issues/2150
>> 
>> However, the issue was closed, and I was recommended this email list.  If someone has implemented redis with flask's session, or have ideas, would you mind assisting?
>> 
>> 
>> Thank you,
>> 
>> Jeff Levesque
>> https://github.com/jeff1evesque
>> _______________________________________________
>> Flask mailing list
>> Flask at python.org
>> https://mail.python.org/mailman/listinfo/flask
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/flask/attachments/20170114/9f6d34d4/attachment.html>


More information about the Flask mailing list