浏览代码

editor route can get url parameter

weichen 4 年之前
父节点
当前提交
0c80cdbc09
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      backstage/editor/routes.py

+ 3 - 2
backstage/editor/routes.py

@@ -1,4 +1,4 @@
-from flask import render_template, Blueprint
+from flask import render_template, Blueprint, request
 
 
 editor_app = Blueprint('editor', __name__)
@@ -6,4 +6,5 @@ editor_app = Blueprint('editor', __name__)
 
 @editor_app.route('/backstage/editor')
 def editor():
-    return render_template('editor.html', title='Type Editor', url='/collection/doll_and_drum_set')
+    url = request.args.get('url', type=str)
+    return render_template('editor.html', title='Type Editor', url=url)