Forums

Error running WSGI application

I have the following error:

2020-02-14 04:32:14,656: ***************************************************
2020-02-14 04:40:21,974: Error running WSGI application
2020-02-14 04:40:21,974:   File "/home/diegomedflo10/mysite/flask_app.py", line 337
2020-02-14 04:40:21,975: 
2020-02-14 04:40:21,975:     global connection
2020-02-14 04:40:21,975: 
2020-02-14 04:40:21,975:          ^
2020-02-14 04:40:21,975: 
2020-02-14 04:40:21,975: SyntaxError: invalid syntax
2020-02-14 04:40:21,975:   File "/var/www/diegomedflo10_pythonanywhere_com_wsgi.py", line 16, in <module>
2020-02-14 04:40:21,975:     from flask_app import app as application  # noqa
2020-02-14 04:40:21,975: ***************************************************
2020-02-14 04:40:21,975: If you're seeing an import error and don't know why,
2020-02-14 04:40:21,975: we have a dedicated help page to help you debug: 
2020-02-14 04:40:21,975: https://help.pythonanywhere.com/pages/DebuggingImportError/
2020-02-14 04:40:21,975: ***************************************************

I don't understand the problem, It was working fine, I just changed some lines of code but i didn't touch that section and now I have this problem.

┬┐how can i fix it? Thanks.

Look at the code before the line where the syntax error is. Changes further up in the code can have an effect on what Python in expecting later on (for example, a change in the expected indent, or an unclosed string literal)