Replaced HAS_SPATIAL_DB by testing database feature

Refs #22632. This should be the base for using more database
features to exclude specific backends in GIS tests.
Thanks Tim Graham for the review.
Fixed broken tests on Oracle after 5853c87a458f62ebd62d7809168355610de2570c.

Oracle doesn't have a `BEGIN` statement so the test would
fail.

Refs #23303
Fixed #21801 -- Documented SingleObjectMixin.get_context_data() requires the object attribute.
Removed unused imports.
Fixed #23316 -- Added datetime.time serialization in migrations.
Fixed #22996 -- Prevented crash with unencoded query string

Thanks Jorge Carleitao for the report and Aymeric Augustin, Tim Graham
for the reviews.
Removed unnecessary code-block directives.
Fixed #10190 -- Made HttpResponse charset customizable.

Thanks to Simon Charette, Aymeric Augustin, and Tim Graham
for reviews and contributions.
Added sphinx extension to ease generation of ticket links.