Hi I get an error message on the following code:
'from flask import *' used; unable to detect undefined names
What could be causing this error? The log file state " SyntaxError: invalid syntax" the code is:
from flask import *
app = Flask(__name__)
@app.route('/')
def home():
return render_template('home.html')
@app.route('/welcome')
def welcome():
return render_template('welcome.html')
@app.route('/hello')
def hello():
return render_template('hello.html')
@app.route('/log', methods=['GET', 'POST'])
def log ():
error = None
if request.method == 'POST':
if request.form['username'] != 'admin' or request.form['password'] != 'admin':
error = 'Invalid credentials, please try again.'
else:
return redirect(url_for('hello'))
return render_template('log.html', error=error)
if __name__ == "__main__":
app.run()