Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions flask_swagger_ui/flask_swagger_ui.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os
import json
from flask import Blueprint, send_from_directory, render_template, request
from flask import Blueprint, send_from_directory, render_template, request, url_for


def get_swaggerui_blueprint(
Expand Down Expand Up @@ -28,7 +28,6 @@ def get_swaggerui_blueprint(

fields = {
# Some fields are used directly in template
"base_url": base_url,
"app_name": default_config.pop("app_name"),
# Rest are just serialized into json string for inclusion in the .js file
"config_json": json.dumps(default_config),
Expand All @@ -49,7 +48,7 @@ def show(path=None):
}
)
fields["config_json"] = json.dumps(default_config)
return render_template("index.template.html", **fields)
return render_template("index.template.html", base_url=url_for(".show"), **fields)
else:
return send_from_directory(
# A bit of a hack to not pollute the default /static path with our files.
Expand Down