Using django, the convention for importing a model from one app to another, is AppName.ModelName
and now you can use it in say a ForeignKey. Does this also stand with User models when using django.contrib.auth.get_user_model
? Because I have an application where I am trying to assign the user model to another model Foo
such that Foo.user=get_user_model()
and when I run makemigrations
, I keep getting this error: TypeError: __init__() missing 1 required positional argument: 'to'
What am I missing here?
I have also tried assigning ForeignKey model to settings.AUTH_USER_MODEL
Figured it out, thanks… i had a typo