Support validating cache backends on Django 1.6 and 1.11.

Review Request #10506 — Created April 3, 2019 and submitted

Review Board

This adds support for validating the cache backend in the General
Settings page on Django 1.11. We no longer have access to get_cache(),
which was present on Django 1.6, so we now duplicate the functionality
by importing the backend manually and then constructing an instance of
the backend.

In order to test this on Django 1.11, a change needed to be made to the
cache field display logic for the form. Modern versions set the
required attribute on required fields, which meant that the form
couldn't be submitted due to the hidden fields for other backends. We
now dynamically set the required field based on the current backend
and the presence of a required CSS class on the label (which is
available on both).

Tested the form on Django 1.6 and 1.11. Checked for both validation
failures and successful validation.

Support validating cache backends on Django 1.6 and 1.11.
  1. Ship It!
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-4.0.x (5d79cef)