From 402f003ca22e524021f53fd46421714f2d0b7d05 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Fri, 16 Nov 2012 03:20:25 +0100 Subject: [PATCH] Honor $PORT environment variable. --- gunicorn/config.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gunicorn/config.py b/gunicorn/config.py index 1901d492..35d7ae22 100644 --- a/gunicorn/config.py +++ b/gunicorn/config.py @@ -319,7 +319,12 @@ class Bind(Setting): cli = ["-b", "--bind"] meta = "ADDRESS" validator = validate_string - default = "127.0.0.1:8000" + + if 'PORT' in os.environ: + default = '0.0.0.0:{0}'.format(os.environ.get('PORT')) + else: + default = '127.0.0.1:8000' + desc = """\ The socket to bind.