From f0e6eb7901ff48bf892745387d2c552d68e5de95 Mon Sep 17 00:00:00 2001 From: aliabd Date: Thu, 24 Sep 2020 00:02:55 +0400 Subject: [PATCH] static files fix --- gradio/networking.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/gradio/networking.py b/gradio/networking.py index f3fcf76058..7d98fdfbc7 100644 --- a/gradio/networking.py +++ b/gradio/networking.py @@ -34,8 +34,8 @@ STATIC_PATH_LIB = pkg_resources.resource_filename("gradio", "static/") app = Flask(__name__, template_folder=STATIC_TEMPLATE_LIB, - static_url_path="/static/", - static_folder=STATIC_PATH_LIB) + static_folder=None) # TODO (aliabid94): replace with default static +# handler app.app_globals = {} # Hide Flask default message @@ -85,6 +85,11 @@ def main(): ) +@app.route("/static/") +def static(path): + return send_file(os.path.join(STATIC_PATH_LIB, path)) + + @app.route("/config/", methods=["GET"]) def config(): return jsonify(app.app_globals["config"])