[1.7.x] Fixed #22429 -- Incorrect SQL when using ~Q and F

Backport of 5e1f4656b9 from master
[1.7.x] Fixed #22575 -- Fixed typo in docs/topics/class-based-views/generic-editing.txt.

Thanks adminq80 at gmail.com.

Backport of 87776859af from master
[1.7.x] Fixed #22489 -- missing implemenation for search lookup

When custom lookups were added, converting the search lookup to use
the new Lookup infrastructure wasn't done.

Some changes were needed to the added test, main change done by
committer was ensuring the test works on MySQL versions prior to 5.6.

Backport of 7131e14d00 from master
[1.7.x] Fixed #1349 -- Clarified docs on serving files from STATIC/MEDIA_URL.

Backport of fb7c347f7b from master
[1.7.x] Fixed #22466 -- ordering by reverse foreign key

Ordering by reverse foreign key was broken by custom lookups patch
(commit 20bab2cf9d02a5c6477d8aac066a635986e0d3f3).

Thanks to everybody who helped solving this issue. Special thanks to
Trac alias takis for reporting this.

Backport of 3b7c66a3ac from master
[1.7.x] Reordered tutorial 1 so that the database is configured first.

This change is required after the introduction of
SessionAuthenticationMiddleware to the default middleware

Backport of 6923fdbbf1 from master
[1.7.x] Fixed #22570 -- Made Form.__getitem__ KeyError more descriptive.

Backport of df60db0e78 from master