Go to file
Florian Apolloner e1721ece48 [2.1.x] Fixed #29849 -- Fixed keep-alive support in runserver.
Ticket #25619 changed the default protocol to HTTP/1.1 but did not
properly implement keep-alive. As a "fix" keep-alive was disabled in
ticket #28440 to prevent clients from hanging (they expect the server to
send more data if the connection is not closed and there is no content
length set).

The combination of those two fixes resulted in yet another problem:
HTTP/1.1 by default allows a client to assume that keep-alive is
supported unless the server disables it via 'Connection: close' -- see
RFC2616 8.1.2.1 for details on persistent connection negotiation. Now if
the client receives a response from Django without 'Connection: close'
and immediately sends a new request (on the same tcp connection) before
our server closes the tcp connection, it will error out at some point
because the connection does get closed a few milli seconds later.

This patch fixes the mentioned issues by always sending 'Connection:
close' if we cannot determine a content length. The code is inefficient
in the sense that it does not allow for persistent connections when
chunked responses are used, but that should not really cause any
problems (Django does not generate those) and it only affects the
development server anyways.

Refs #25619, #28440.

Regression in ac756f16c5.
Backport of 934acf1126 from master.
2018-11-20 17:44:03 -05:00
.tx Removed contrib-messages entry in Transifex config file 2016-06-29 21:11:30 +02:00
django [2.1.x] Fixed #29849 -- Fixed keep-alive support in runserver. 2018-11-20 17:44:03 -05:00
docs [2.1.x] Fixed #29849 -- Fixed keep-alive support in runserver. 2018-11-20 17:44:03 -05:00
extras Refs #23919 -- Removed Python 2 reference in django_bash_completion. 2017-07-10 08:54:52 -04:00
js_tests [2.1.x] Fixed #29536 -- Fixed SelectFilter2.js resizing to make boxes have equal height. 2018-06-29 17:23:16 +02:00
scripts [2.1.x] Capitalized "Python" in docs and comments. 2018-10-09 20:50:31 -04:00
tests [2.1.x] Fixed #29849 -- Fixed keep-alive support in runserver. 2018-11-20 17:44:03 -05:00
.editorconfig [2.1.x] Refs #29784 -- Switched to https:// links where available. 2018-10-09 20:52:43 -04:00
.eslintignore Refs #16501, #26474 -- Added xregexp.js source file. 2016-06-06 09:25:02 -04:00
.eslintrc Fixed #25165 -- Removed inline JavaScript from the admin. 2015-12-05 15:51:57 -05:00
.gitattributes Fixed #19670 -- Applied CachedFilesMixin patterns to specific extensions 2016-03-30 14:34:41 +02:00
.gitignore Fixed #22446 -- Added tox.ini to automate pull request checks. 2016-07-20 14:06:28 -04:00
.hgignore Synced .hgignore with .gitignore 2015-07-01 10:23:05 -04:00
AUTHORS [2.1.x] Refs #29877 -- Made diveinto.org URLs HTTPS. 2018-10-23 15:03:40 +02:00
CONTRIBUTING.rst Added link to the code of conduct from contributing guides. 2015-04-17 18:12:41 -04:00
Gruntfile.js Fixed qunit tests (coverage still missing). (#7716) 2016-12-19 18:45:37 +01:00
INSTALL Fixed #27857 -- Dropped support for Python 3.4. 2017-09-25 17:11:03 -04:00
LICENSE Whitespace cleanup. 2013-10-10 16:49:20 -04:00
LICENSE.python Updated Python license for 2018. 2018-01-05 08:13:55 -05:00
MANIFEST.in Simplified MANIFEST.in 2015-12-12 12:07:21 -05:00
README.rst [2.1.x] Removed dead links to botbot.me. 2018-11-10 17:25:47 -05:00
package.json Fixed qunit tests (coverage still missing). (#7716) 2016-12-19 18:45:37 +01:00
setup.cfg [2.1.x] Ignored flake8 W504 warnings. 2018-10-24 09:25:34 -04:00
setup.py [2.1.x] Bumped version for 2.1 release. 2018-08-01 09:56:13 -04:00
tox.ini [2.1.x] Refs #28814 -- Documented Python 3.7 compatibility. 2018-06-28 11:05:32 -04:00

README.rst

Django is a high-level Python Web framework that encourages rapid development
and clean, pragmatic design. Thanks for checking it out.

All documentation is in the "``docs``" directory and online at
https://docs.djangoproject.com/en/stable/. If you're just getting started,
here's how we recommend you read the docs:

* First, read ``docs/intro/install.txt`` for instructions on installing Django.

* Next, work through the tutorials in order (``docs/intro/tutorial01.txt``,
  ``docs/intro/tutorial02.txt``, etc.).

* If you want to set up an actual deployment server, read
  ``docs/howto/deployment/index.txt`` for instructions.

* You'll probably want to read through the topical guides (in ``docs/topics``)
  next; from there you can jump to the HOWTOs (in ``docs/howto``) for specific
  problems, and check out the reference (``docs/ref``) for gory details.

* See ``docs/README`` for instructions on building an HTML version of the docs.

Docs are updated rigorously. If you find any problems in the docs, or think
they should be clarified in any way, please take 30 seconds to fill out a
ticket here: https://code.djangoproject.com/newticket

To get more help:

* Join the ``#django`` channel on irc.freenode.net. Lots of helpful people hang
  out there. See https://en.wikipedia.org/wiki/Wikipedia:IRC/Tutorial if you're
  new to IRC.

* Join the django-users mailing list, or read the archives, at
  https://groups.google.com/group/django-users.

To contribute to Django:

* Check out https://docs.djangoproject.com/en/dev/internals/contributing/ for
  information about getting involved.

To run Django's test suite:

* Follow the instructions in the "Unit tests" section of
  ``docs/internals/contributing/writing-code/unit-tests.txt``, published online at
  https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/unit-tests/#running-the-unit-tests