Default automatic imports in the shell

I’m much more concerned about making sure we’ve provided good hooks to have default imports than that we’ve thought of even the common cases. If we have a good hook, then the specific things we choose become an implementation detail, and one that folks are very likely to wish to customize to their own particular tastes.

I agree that any default set should be carefully curated, because this will be as much of a public interface as most anything else is. I’m in favor of avoiding auto-imports in python manage.py shell -c, but I think that we won’t to break blog posts and examples that rely on auto-imports.

For my tastes, I’d prefer auto-imports not be printed out by default, but would be happy for them in verbose mode. Probably controversially, and further motivating my push for hooks to customize the behavior, I’d prefer that things not be namespaced, so individual models, fields, ORM functions, etc should not be namespaced in auto-imports (e.g. DateTimeField instead of models.DateTimeField). It’s worth noting that settings is a necessary exception, because it’s actually an object that proxies settings and isn’t referencing the model directly.