소스 검색

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)