import os
for k, v in os.environ.items():
if k.startswith("GUNICORN_"):
key = k.split("_", 1)[1].lower()
locals()[key] = v
if "PORT" in os.environ:
locals()["bind"] = "0.0.0.0:{}".format(os.environ["PORT"])