Do you and should you rename a custom User model in Django 1.9?
<p>I am creating a new User model for my Django project. I have been many people calling their custom user model, XXXUser and custom user manager, XXXUserManager.  </p>

<p>I was wondering if there is a reason for this.  Can you just create a custom user and still call it User?  Does this create conflicts in the code?</p>

<p>Basically you can. But for readability purposes it's better to do it <code>XxxUser</code>, if you see <code>XxxUser</code> you are instantly understand that this is custom one. And you need to keep in mind that you should replace some code that is common for base usage.</p>

<p>Such as(should be replaces)</p>

<pre><code>from django.contrib.auth.models import User
</code></pre>

<p>Should be </p>

<pre><code>from django.contrib.auth import get_user_model
User = get_user_model()
</code></pre>

<p>And if you reference to <code>User</code> model in your <em>models.py</em> you need to</p>

<pre><code>from django.conf import settings

class SomeModel(models.Model):
    field = models.RetationField(settings.AUTH_USER_MODEL)
</code></pre>

<p>Also do not forget to set your <code>settings.AUTH_USER_MODEL</code> that references to your custom one</p>

python django django-admin django-1.9