[1.5.x] Fixed #20036 -- Improved GEOS version string parsing

Thanks chikiro.spam at gmail.com for the report.
Backport of 747f7d254 from master.
[1.5.x] Updated our six module to follow upstream changes.

This includes fixes for the java/jython detection and a new license header.

Thanks to Thomas Bartelmess for the report.

Backport of c5ce0e8a687ecf7fbc38fa85c5311a6320a246c6 from master.
[1.5.x] Updated bundled version of six.

Backport of e11ccc76d325b6bbbf101f510a91299f507f0745.
[1.5.x] Stopped using non-standard __globals__ and __code__ attributes.

Some alternative implementations don't have them.

Closes #19944.

Backport of 9d4a5b00f1977d8cddf8e241fa4bb8a9e819f188 from master.
[1.5.x] Minor docs fix for e11ccc76.

Backport of f3a6d74 from master.
[1.5.x] Fixed #20051 -- Specified where to define `TEMPLATE_DIRS`.
[1.5.x] Revert "Fixed #19895 -- Made second iteration over invalid queryset raise an exception too"

This reverts commit d1e87eb3baf75b1b6a0ada46a9b77f7e347cdb60.
This commit was the cause of a memory leak. See ticket for more details.
Thanks Anssi Kääriäinen for identifying the source of the bug.
[1.5.x] Fixed #20096 -- Added link to the Greek localflavor app

Backport of a9ee0e297 from master.
[1.5.x] Fixed #17935 - Clarified intro of topics/files.txt.

Thanks guettli for the suggestion.

Backport of f7795e968d from master
[1.5.x] Fixed #20094 - Be more careful when checking for Iterator

Python 2.6 has some different behaviour when checking
isinstance(foo, collections.Iterator).
Backport of 829dc3c5 from master.
[1.5.x] Fixed #20108 -- Fixed filepath_to_uri decoding error

This was a regression due to unicode_literals usage. Thanks Ivan
Virabyan for the report and the initial patch.
Backport of 164528acc8 from master.
[1.5.x] Fixed docs template name typo

Backport of a907fa088e from master
[1.5.x] Added missing markup to docs.

Backport of 93cffc3b37 from master.