By using flask, we can point the html file or python file in routing.

To achieve this we need render_template library.


from flask import render_template

The html file must be placed in templates directory.

So you must create a directory named templates.


@app.route('/about')
def hello(name=None):
    return render_template('about.html')

You must return a html file using render_template.

about-flask