Flaskr SyntaxError

I am testing the Flaskr tutorial (http://flask.pocoo.org/docs/), and after trying to start flaskr.py using the terminal, I got the following error:

if __name__ == '__main__':
                             ^
SyntaxError: invalid syntax

I have absolutely no idea why I got this error. Can someone help me?

+5
source share
1 answer

You forgot the closing bracket in your line return, above your statement if __name__ == "__main__":, you put

return redirect(url_for('show_entries')

and it should be

return redirect(url_for('show_entries'))
+13
source

All Articles