Falcon-REST-API-Pattern
Falcon-REST-API-Pattern copied to clipboard
How do I read environment variables and stop gunicorn if not found
Currently I am doing the following:
path = os.environ.get('DATABASE_PATH')
if path==None:
print "SET DATABASE_PATH, using --env key=value"
sys.exit()
api = falcon.API(middleware=[cors.middleware])
And when I run, I run as follows: gunicorn app:api --env "DATABASE_PATH=some path"
However, if I don't give the path, the gunicorn server does not stop on it's own but keeps running like the following:

How do I stop the server?
it may help
- to exit process----clt+z
- to see how many server is running------ ps -ef|grep "gunicorn"
- then to kill the server-----sudo kill -9 2303 (server-2303 )