move django imports into actual execution so import is not a problem even with missing optional dependency.