Honor $PORT environment variable.

This commit is contained in:
Kenneth Reitz 2012-11-16 03:20:25 +01:00 committed by benoitc
parent 6f726e0ec9
commit 402f003ca2

View File

@ -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.