[1.7.x] Removed code deprecated from Django 1.2

Backport of 2779c299c8 from master.
[1.7.x] Fixed a few warnings in the testsuite.

Backport of 536ebaa048f69c18aa36448074f65f2741e35df5 from master.
[1.7.x] Removed executeable bit from a few files.

Backport of 9d1bf8f841af27c70d1fa5817e88d893ce7c0507 from master.
[1.7.x] Restored Python 2 compatibility.

Backport of ee51ab9d232e52d17cd5ad32e230fd715cffe638 from master.
[1.7.x] Fixed typo in docs/ref/models/custom-lookups.txt.

Backport of 2b432d4634 from master
[1.7.x] Fixed #22692 -- Added docs for `makemigrations` two command options.

Added documentation about `--dry-run` and `--merge`.

Backport of e98d303562 from master