直接打开HTML文件,显示正常,但是放到Flask程序中运行 打开后的结果就是源代码
1条回答 默认 最新
- CSDN专家-showbo 2021-10-21 09:55关注
试试make_response
from flask import render_template, make_response class AppointmentController(Resource): def __init__(self): pass def get(self): headers = {'Content-Type': 'text/html'} return make_response(render_template('index.html'),200,headers)
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报