0

This is something similar to this post Running a flask server. I wanted to check if there is any other option other than deploying the flask app to keep it running for debugging purpose.

I work on a python program hosted in linux server. The program uses flask as it is a web based application. I am connecting to the linux server using putty progaram in Windows. So i run the program using python mainprogram.py in putty and i can view the application is running and can be opened in the browser.

But the application gets closed when putty is closed. How can i keep the application running even after i close putty. below is the URL set for the app

if __name__ == "__main__":
    app.run(host='0.0.0.0', port=5000, threaded=True, debug=True)  
Community
  • 1
  • 1
kten
  • 445
  • 4
  • 13
  • 26
  • 1
    http://askubuntu.com/questions/396654/how-to-run-the-python-program-in-the-background-in-ubuntu-machine might help. – Andrew Guy Jul 20 '16 at 05:17
  • 2
    I think [this](http://stackoverflow.com/questions/2975624/how-to-run-a-python-script-in-the-background-even-after-i-logout-ssh) is what you are looking for – limbo Jul 20 '16 at 05:18
  • 1
    Thanks !! this command worked. "nohup python mainprogram.py & " – kten Jul 20 '16 at 05:39
  • a program called [GNU screen](https://en.wikipedia.org/wiki/GNU_Screen) will keep the python session going even if you disconnect – Paul Jul 20 '16 at 08:46

0 Answers0