Replace flask-cache With Werkzeug Issues

Oct 4, 2020

Flask-Caching is a fork and drop in replacement for Flask-Cache (No longer maintained since Mar 2013)

Flask-Cache issues

    from werkzeug import import_string
ImportError: cannot import name import_string
    from werkzeug.contrib.cache import (BaseCache, NullCache, SimpleCache, MemcachedCache,
ImportError: No module named contrib.cache

Install Flask-Caching

pip install Flask-Caching

Latest version of Flask-Caching only support Python 3. Bump into the following issues when trying to use it on Python 2

    nonlocal source_check                        ^SyntaxError: invalid syntax

For support on Python 2, use

pip install Flask-Caching==1.7.2

❤️ Is this article helpful?

Buy me a coffee ☕ or support my work via PayPal to keep this space 🖖 and ad-free.

Do send some 💖 to @d_luaz or share this article.

✨ By Desmond Lua

A dream boy who enjoys making apps, travelling and making youtube videos. Follow me on @d_luaz

👶 Apps I built

Travelopy - discover travel places in Malaysia, Singapore, Taiwan, Japan.