I have a flask server and it is deployed on digital ocean droplet with production WSGI server and it is working fine there.
But the issue is that after one day flask server goes to sleep and it gives error that no server running and when I restart my service then it again works properly. I don’t why it show this behaviour:
from flask import Flask
app = Flask(__name__)
@app.route('/')
def index():
return '<h1>Hello!</h1>'
if __name__ == "__main__":
app.run(debug=True)
And I get this message:
Status: 502, no server is running
I use WSGI approach to make the flask server at production level but this solution also don’t work in my case.