好长时间没写了,今天复习了一下就遇到了问题:
from flask import Flask, render_template
app = Flask(__name__)
@app.route('/', methods=['GET'])
def cmt():
return render_template('index.html')
if __name__ == '__main__':
app.run()
可index.html就在templates中,怎么回事呢?
截图贴不上来,
路径是
C:\Users\Deyuan.Li\Documents\company\web\xdmed
xdmed下有 app.py, templates, venv文件,index.html就在templates文件夹下。
用Pycharm写的