[Flask] Storage Context

Gergely Polonkai gergely at polonkai.eu
Fri Jul 26 09:26:33 EDT 2019


I never used web2py, but from the documentation it looks like some basic
caching functionality. If this is the case, you should check Flask-Caching
(a fork of the unmaintained Flask-Cache). It can store the cache in memory
or in a file, or connect to memcached, Redis, and a bunch of other storage
backends.

(Disclaimer: i’m one of the maintainers of that package).

If, however, you don’t need a persistent(ish) cache, the simplest solution
is probably to set g.my_storage to a dictionary and use the dictionary
methods to access it.

Best,
Gergely


Gergely Polonkai
[image: https://]about.me/gergely.polonkai
<https://about.me/gergely.polonkai?promo=email_sig&utm_source=email_sig&utm_medium=email_sig&utm_campaign=external_links>


fös., 26. júl. 2019 kl. 13:16 skrifaði Ben Duncan <linux4ms at gmail.com>:

> Ok, I'm coming form web2py and adopting Flask
> However, one of the things I had under web2py is a module called Storage.
> It worked much like a memcach database.
>
> See: https://web2py.readthedocs.io/en/latest/storage.html
>
> Is there anything like that in Flask?
> I've adapted the storage module for my use in Flask, but I'd rather use
> anything native
> to Flask.
>
> Thanks ..
>
> *Ben Duncan*
> DBA / Chief Software Architect
> Mississippi State Supreme Court
> Electronic Filing Division
> _______________________________________________
> 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/20190726/6940cc8b/attachment.html>


More information about the Flask mailing list