Python-Flash HTML静的ページ戻り
Rest API-HTML静的ページを返す
from flask import Flask, jsonify, request, render_template
app = Flask(__name__)
@app.route('/html_test')
def hello_html():
# html file은 templates 폴더에 위치해야 함
return render_template('test.html')
""" flask의 render_template 메서드를 활용하면 정적 html 페이지를 리턴할 수 있다.
html 파일은 반드시 templates 폴더 하위에 위치해야한다. """
Reference
この問題について(Python-Flash HTML静的ページ戻り), 我々は、より多くの情報をここで見つけました https://velog.io/@tkjung/파이썬-Flask-HTML-정적-페이지-리턴テキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol