How i can set templates dir for Flask app ?
Hello
I have this structure
Project
|__ application
|__ static
|__ templates
|__ modules
|
I have this structure
Project
|__ application
|__ static
|__ templates
|__ modules
|
Please sign in to leave a comment.
you should select template language in Settings->"Python Template Languages" and then right click on the folder and choose "Mark directory as template"
I've marked the templates directory as such and checked that html/jinja2 is selected as template language in settings.
Still getting warnings that the template files cannot be found in these blocks of code:
@app.errorhandler(404) def page_not_found(e): return render_template('404.html'), 404 @app.errorhandler(500) def internal_server_error(e): return render_template('500.html'), 500 @app.route('/', methods=['GET', 'POST']) def index(): name = None form = NameForm() if form.validate_on_submit(): name = form.name.data form.name.data = '' return render_template('index.html', form=form, name=name)@Monte - Have you turned it off and on again? Respectively, have you closed IntelliJ and opened it again? This did the trick for me.