Flaskr SyntaxError
Asked Answered
F

1

5

I'm trying out the Flaskr tutorial(http://flask.pocoo.org/docs/) and I got the following error after I tried to run flaskr.py using the terminal:

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

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

Fosterling answered 26/3, 2011 at 2:8 Comment(2)
could you add the original part of code related to this error please?Aeneus
here it is- gist.github.com/887965Fosterling
A
14

You have forgotten a closing parenthesis in your return line, above your if __name__ == "__main__": statement, you put

return redirect(url_for('show_entries')

and it should be

return redirect(url_for('show_entries'))
Aeneus answered 26/3, 2011 at 2:31 Comment(3)
thanks but another error showed up- before_request() takes exactly 2 arguments (1 given)....Fosterling
and in the tutorial its written- before_request() takes now argumentFosterling
problem solved- spotted two brackets that shouldn't have been there. Thanks a lot!!Fosterling

© 2022 - 2024 — McMap. All rights reserved.