From ad3a0aea833a26735d1d2986f427e9f286dbac21 Mon Sep 17 00:00:00 2001 From: Ben Sturmfels Date: Wed, 1 Apr 2020 15:32:42 +1100 Subject: [PATCH] Handle moved SharedDataMiddleware in werkzeug >= 0.15.0. --- mediagoblin/app.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mediagoblin/app.py b/mediagoblin/app.py index 345aa048..1e0808bb 100644 --- a/mediagoblin/app.py +++ b/mediagoblin/app.py @@ -24,8 +24,11 @@ from mediagoblin.tools.routing import endpoint_to_controller from werkzeug.wrappers import Request from werkzeug.exceptions import HTTPException from werkzeug.routing import RequestRedirect -from werkzeug.wsgi import SharedDataMiddleware - +try: + # Werkzeug >= 0.15.0 + from werkzeug.middleware.shared_data import SharedDataMiddleware +except ImportError: + from werkzeug.wsgi import SharedDataMiddleware from mediagoblin import meddleware, __version__ from mediagoblin.db.util import check_db_up_to_date from mediagoblin.tools import common, session, translate, template -- 2.25.1