PyCharm cannot find a Flask template that exists

PyCharm Code Editor displays popup message Template file 'index.html' not found

when submitting "index.html"

to render_template

. The template templates/index.html

exists. Access to the http://localhost:5000/

renders template. How do I tell PyCharm that a template exists?

@app.route('/')
def index():
    return render_template('index.html')

      

enter image description here

+3


source to share


1 answer


Right-click on the template directory, go to "Mark directory as" and select "Template directory".



+4


source







All Articles