I wrote a Flask application, and also got it working with the commands that you normaly use to start it.
That means:
cd /var/www/BWSWebApp
export FLASK_APP=main.py
flask run --host=0.0.0.0
Explanation (row for row):
cd into the directory the main.py file is in.
Export the main.py file.
Run flask server with an IP-address that can be seen in the whole network.
Now I don't want to manually type that in the console every time I want to start the Flask application. So i thought myself that I could simply write another Python file with the following
import os
os.system('cd /var/www/BWSWebApp')
os.system('export FLASK_APP=main.py')
os.system('flask run --host=0.0.0.0')
But when i run the file it doesn't starts the server, and in the Python console i also don't see any output.
Can anyone help me out with that?