Forums

Flask not working anymore, worked before

Hello,

nothing was update over weeks but it does not work anymore. I only get

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/home/.../mysite/main.py", line 34, in <module>
    app.run(debug=True)
  File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 920, in run
    run_simple(t.cast(str, host), port, self, **options)
  File "/usr/local/lib/python3.10/site-packages/werkzeug/serving.py", line 1059, in run_simple
    s = prepare_socket(hostname, port)
  File "/usr/local/lib/python3.10/site-packages/werkzeug/serving.py", line 927, in prepare_socket
    sys.exit(1)

Debug show me no more information. What is the Problem. It worked perfekt before, for weeks.

Any idea what die Problem is. The Phyton part works perfect, it is flask what makes a problem suddenly on pythonanywhere which worked

regards

[edit by admin: formatting]

How are you running your code? It looks like you're trying to use the Flask app.run function, which is to start the development server for local testing -- you don't need to do that on PythonAnywhere.

if name == 'main': app.run(debug=True)

this is how i use it, worked before but not anymore.

How are you running the code? Are you seeing that error in a console, or when you try to run the site from inside a console? If you do that then the code that is guarded by the if __name__ == "__main__": will be run, so it will try to start the debug server. But there is no need to run a Flask website in a console on PythonAnywhere. Once it's been set up on the "Web" page, then it will be running.

Thx, what i found out was that pytube is not working like before because they changed something on YT with check 18 Video. That is the problem an not flask.

regards and thank you for your time to answer