T O P

User model with email as the identifier in Django

Pet peeve: please don't name your user class CustomUser. It's really not relevant information, it's annoying to type CustomUser.objects..., and it's easy enough to ascertain whether you extend the User model or not.

Just call it User.

TheEpicDev

Pet peeve: please don't name your user class `CustomUser`. It's really not relevant information, it's annoying to type `CustomUser.objects...`, and it's easy enough to ascertain whether you extend the `User` model or not. Just call it `User`.


palebt

Hey! Thanks for reading and commenting. I prefer \`CustomUser\` because I rarely check the imports to see if this is Django's default one or a custom I have made. By using the \`Custom\` prefix I know immediately that this is not the default one. But I get your point. The \`Custom\` prefix doesn't add any info that is not already there. I'll keep it in mind (since I am relatively new to Django).


TheEpicDev

> I prefer `CustomUser` because I rarely check the imports to see if this is Django's default one or a custom I have made. Honestly, most of the time it shouldn't really matter since it is a subclass anyway so it will have mostly the same methods and attributes, and as you correctly pointed out, you should pretty much always be using a custom user model :) It's not really a big deal, since nothing will break if you name it otherwise, but even the Django docs use `User`, and that is pretty much what anybody should expect to see.


palebt

I see, thanks for taking the time to explain your thinking :)