[1.7.x] Fixed #22254 -- Noted the requirement of calling django.setup() when running

Thanks Peter Landry for the report.

Backport of 26b03f2526 from master