PyCharm找不到存在的Flask模板

nal*_*zok 5 python pycharm flask

PyCharm的代码编辑器显示弹出式消息Template file 'index.html' not found传递的时候"index.html"render_template.模板templates/index.html存在.访问http://localhost:5000/呈现模板.如何告诉PyCharm该模板是否存在?

@app.route('/')
def index():
    return render_template('index.html')
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

dav*_*ism 10

右键单击您的模板目录,转到"将目录标记为",然后选择"模板目录".