python - How to open html containing framset using flask framework -


i want open index.html,

but can not find pic.html

how do

pic.html , index.html in templates

index.html

  <body>     <iframe src="pic.html"></iframe>   </body> 

flaskdemo.py

from flask import flask,render_template  app = flask(__name__)   @app.route('/') def hello_world():     return render_template("index.html")  if __name__ == '__main__':     app.run() 

flask doesn't serve files templates directory. need set route /pic.html , render appropriate template part of that:

from flask import flask,render_template  app = flask(__name__)   @app.route('/') def hello_world():     return render_template("index.html")  @app.route('/pic.html') def pic():     return render_template("pic.html")  if __name__ == '__main__':     app.run() 

Comments

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

objective c - Greedy NSProgressIndicator Allocation -

how to set an OCR language in Google Drive -