Forums

try except syntax error

newbie question with flask. I'm following some tutorial on how to add user logins and such and I'm not getting far because of this error.

@app.route('/login', methods=['GET', 'POST'])
def login():
    message=[]
    try:
    #stuff
    except Exception as e:
                message+=[e]
                return url_for('index', message=message)

on the "except Exception as e:" line the built in editor is saying I have a Syntax error.

Any help will be appreciated!

You may need to have something in place of #stuff, and it should be indented.