I am trying to import Django User model in ipython inside virtual environment. I have tried the following code
from django.contrib.auth.models import User
It resulted in the following error
AppRegistryNotReady: Apps aren't loaded yet.
Then from this answer, I have setup inside the shell and tried the following code.
from django.conf import settings
User = settings.AUTH_USER_MODEL
User.objects.create_user('john', 'lennon@thebeatles.com', 'johnpassword')
This resulted in AttributeError: 'str' object has no attribute 'objects' .
How can I create a user inside ipython shell? I am using Django 1.10.6,
ipython 6.0.0 and djangorestframework 3.6.2