Skip to content

How do I read environment variables and stop gunicorn if not found #1

@ayushidalmia

Description

@ayushidalmia

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:

screen shot 2016-08-31 at 8 21 02 pm

How do I stop the server?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions