[autotest] Clarify django ImproperlyConfigured exception.

If a developer imports a django models or django models dependent module
before importing one of the django setup modules, they get a slightly
cryptic ImproperlyConfigured exception from Django which doesn't point
them in the direction of our existing django setup modules. This CL
catches the exception and rethrows it as a more descriptive one.

BUG=None
TEST=From interactive python session, import common, then import
direct_afe without first importing one of the the db setup modules. See
clearer exception message.

Change-Id: I397bbd1d3762b9cba0f4f6203c6b73a5d8de9212
Reviewed-on: https://gerrit.chromium.org/gerrit/50901
Commit-Queue: Aviv Keshet <akeshet@chromium.org>
Reviewed-by: Aviv Keshet <akeshet@chromium.org>
Tested-by: Aviv Keshet <akeshet@chromium.org>
1 file changed