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 폴더 하위에 위치해야한다. """