I am following the Quickstart Guide for Flask. http://flask.pocoo.org/docs/quickstart/#static-files I'm getting this error as I follow the guide.
/application
/__init__.py
/templates
/hello.html
@app.route('/hello/')
@app.route('/hello/<name>')
def hello(name=None):
return render_template('hello.html', name=name)
>python _init_.py
Traceback (most recent call last):
File "_init_.py", line 4, in <module>
@app.route('/hello/')
NameError: name 'app' is not defined
Perhaps this?
from flask import Flask, request, render_template
The only thing missing is
from flask import Flask, render_template
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With