Move "import gevent.wsgi" into a separate module, which is not
imported if pywsgi worker is requested. (The gevent.wsgi currently
not provided by gevent trunk but pywsgi works fine.)
mange.py have to use USR2 signal if they want to upgrade the django
version instread of HUP. On the other hand, upgrading django version
with HUP is possible with gunicorn_django command.
If an app iterator attempts to send an empty string to the client
while using chunked transfer encoding it incorrectly signals the
end of the transfer. This patch just ignores empty strings that
are yielded by the application.
change remove it from loaded modules on reload. While we are here we
remove any django module preloaded so we can upgrade django version to
on HUP. fix issue #197.
Validate models before allowing connections via gunicorn_django
This prevents issues where the site is accepting connections but not all
of the models have loaded yet. If your model importing has side effects
(monkey-patching, etc) this can results in errors about missing attributes
or features simply because the code that enables those features as not been
run yet.
This issue does not affect the "run_gunicorn" management command as that
performs it's own model validation before allowing connections, so we are
simply making this consistent here.
Signed-off-by: Chris Lamb <lamby@debian.org>
* Always log the exception locally
* Still only pass the exception in the HTTP response if
debug is turned on.
* Slight cosmetic changes to the actual HTML of the error
response.
content-length is provided and http version >= 1.1. In other case send
until we content is empty.
Also HTTP don't expect we can send more than content-length if header is
set, so discard any content if we have already send the expected
lenghth. (spotted by @GrahamDumpleton)
reviewed and OK by @davisp. More readable function by @davisp
After messing around trying to make this more elegant we've decided to
just slap a 1s poll to the thing which seems to fix various bugs in the
async event handling.