Currently I am starting my flask server by executing the FLASK_APP=name_of_my_app.py && flask run (I am on Ubuntu). I need to achieve the outcome of initiating the server as above through different means - namely, by running something of the kind: python start_same_server.py. After some refactoring, this does not work for me because it breaks my socket.io (flask-socketio). So I had an idea of just creating a supplementary start_server.py module that looks like this:
Please ignore the Windows shell command (it may be wrong, I have not tested it yet). But I am getting an error in my shell when I do python start_server.py:
/bin/sh: 1: flask: not found
It is because of my lack of understanding on how Popen runs shell commands. How do I make Popen see my flask command? (I had an idea of adding flask to sys.path? Also can python -m flask help here somehow?)
Sorry for the noob question. And thanks for any help.
