Skip to content

meaning of get_by_natural_key #7758

Discussion options

You must be logged in to vote

Make sure to add AUTH_USER_MODEL = 'myapp.MyUser' in settings.py of the Django project.
Here, myapp is the name of that Django app (which must be in your INSTALLED_APPS) and MyUser is the name of the Django model that you wish to use as your user model.

Do this before creating any migrations or running manage.py migrate for the first time.
and make sure to register the model in the app’s admin.py :-

from .models import MyUser

admin.site.register(MyUser)

If still getting the error, follow the steps from this link.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by tomchristie
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #7692 on March 03, 2021 14:27.