Skip to content

Commit

Permalink
Deprecate cache object creation functions in flask_caching.backend
Browse files Browse the repository at this point in the history
  • Loading branch information
gergelypolonkai committed Feb 17, 2021
1 parent 4f98959 commit d6c43b5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions flask_caching/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,11 @@ def init_app(self, app: Flask, config=None) -> None:
def _set_cache(self, app: Flask, config) -> None:
import_me = config["CACHE_TYPE"]
if "." not in import_me:
warnings.warn(
"Using the initialization functions in flask_caching.backend "
"is deprecated. Use the a full path to backend classes "
"directly.",
category=DeprecationWarning)
import_me = type(self).__module__ + '.backends.' + import_me

cache_factory = import_string(import_me)
Expand Down

0 comments on commit d6c43b5

Please sign in to comment.