Hi Mike,

Am 2020-02-14 um 23:30 schrieb Mike Dewhirst:
> In your documentation you mention "from accounts.models import User"
> 
> I have been maybe taking things too literally. After migrating to my custom 
> user I have used "from django.contrib.auth import get_user_model" followed by 
> "User = get_user_model"
> 
> I much prefer your direct route. Is it correct?

Yes, I think so. As I wrote near the top, every code that is to be used by 
others must use the generic referencing method, so that it can deal with 
whatever User model the client code uses.

In your project apps that are not intended for reuse by other "foreign" code, 
there is, imho, no need to use the additional redirection that the generic 
referencing methods bring. You can just import your custom user model there 
directly.

Best regards,
Carsten

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/e7a50241-afba-cd3d-0ab2-08795a87a2d6%40cafu.de.

Reply via email to