I like the idea of autoimporting extra modules. However, I suggest narrowing the datetime
imports, as its usage may not be considered widespread or common in every shell interaction. Specifically, I believe the following would be sufficient:
from datetime import date, datetime, timedelta
I would recommend omitting import datetime as dt
. While I acknowledge Adam’s influence and recognize that it may be adopted by many, it still seems somewhat niche to me. I would suggest leaving this option to the user for customization.
Then I would like to suggest that we autoimport get_user_model
and define User = get_user_model()
, assuming that django.contrib.auth
is listed in INSTALLED_APPS
. In my experience, the second most common usage of the shell is to make an existing user staff or superuser.