diff --git a/examples/djangotest/settings.py b/examples/djangotest/settings.py index 4081555b..c7400265 100755 --- a/examples/djangotest/settings.py +++ b/examples/djangotest/settings.py @@ -1,5 +1,8 @@ # Django settings for djangotest project. +import platform +PRODUCTION_MODE = platform.node().startswith('http') + DEBUG = True TEMPLATE_DEBUG = DEBUG diff --git a/gunicorn/util.py b/gunicorn/util.py index d3af4a86..c355cc52 100644 --- a/gunicorn/util.py +++ b/gunicorn/util.py @@ -80,7 +80,7 @@ def write(sock, data): def write_nonblock(sock, data): timeout = sock.gettimeout() - if sock.gettimeout() > 0.0: + if timeout != 0.0: try: sock.setblocking(0) return write(sock, data)