dimanche 3 janvier 2021

How can I get the flask development environment to work using passenger?

I would like to understand potential errors I'm making during coding a flask application using python using the development environment, terminal window and flask server (export FLASK_ENV=development, export FLASK_APP=app.py, flask run --no-debugger)

Problem: The links Flask generates (e.g. 127.0.0.1:5000) don't work -> ERR_CONNECTION_REFUSED

Problem description: I am using A2hosting which is deploying my Python/Flask App via a so-called passenger_wsgi.py file. Deployment works fine. I'm able to change and open the website. But using flask in the terminal window in a development environment as described above does not work.

What I have tried so far: I think a lot. I have tried to rule out firewall settings as a problem source by using different ports (e.g. 8080) and changed the local server to 0.0.0.0 and tested with another device (my mobile phone). I have also tried using a different wifi connection (my mobile hot spot) and another browser. I have also tried setting FLASK_APP to passenger_wsgi.py instead of app.py.

Not sure what I'm missing. I'm almost sure this problem has something to do with passenger_wsgi, but not sure.

Aucun commentaire:

Enregistrer un commentaire