Implement Migration.run_before

This attribute (used for reverse dependencies) was previously declared
and mentioned in the code, but never actually used.
Fixed RST syntax in 1.8 release docs.
Reordered setUp code in prefetch_related tests.

This allows these tests to run on databases that reject duplicate NULL
values in unique fields e.g. SQL Server.

Forward port of 4fb50a9a from stable/1.7.x.
Avoided using BinaryField unecessarily in tests.

Several database backends struggle with binary data. This change
minimizes the risk of unrelated tests failures when binary fields
trigger errors.

Forward-port of 2e4bcb9b from stable/1.7.x.
Added a flag for the ability to introspect nullable fields.

Previously this was conflated with another Oracle-specific behavior.
Fixed #22746 -- Removed background property from pre/code in admin CSS.
Fixed #21773 -- made daemon threads default in the development server.

Thanks clime for the report.
Fixed #10811 -- Made assigning unsaved objects to FK, O2O, and GFK raise ValueError.

This prevents silent data loss.

Thanks Aymeric Augustin for the initial patch and Loic Bistuer for the review.
Fix missing highlighting in some code examples
Fixed #18400 -- Modified length template filter to return 0 for unknown variables.

Thanks Florian for the bug report, luyikei for the initial code patch, and
Bouke for the code review feedback.
Fixed #20550 -- Added keepdb argument to destroy_test_db
Checked can_introspect_null feature in a test.

Forward-port of 1238f92c from stable/1.7.x.
Replaced an explicit vendor check by a feature flag.

Forward-port of c9aedce0 from stable/1.7.x.
Merge pull request #2736 from SmileyChris/migration-run_before

Fixed #22725 - Migration.run_before does nothing
Rewrote migration autodetector to involve actual computer science.

Fixes #22605, #22735; also lays the ground for some other fixes.
Prevent operation pollution by later operations of fields
Fixed #22773 -- Forced templatize() to return unicode
Merge pull request #2764 from gchp/ticket-20550

Fixed #20550 -- Added keepdb argument to destroy_test_db
Fixed flake8 errors.
Added formatting and line wrapping to checks reference doc.