Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The least painful and indeed Django-recommended way of doing this is through a <code>OneToOneField(User)</code> property.</p> <blockquote> <h2><a href="https://docs.djangoproject.com/en/dev/topics/auth/customizing/#extending-the-existing-user-model" rel="noreferrer">Extending the existing User model</a></h2> <p>&hellip;</p> <p>If you wish to store information related to <code>User</code>, you can use a <a href="https://docs.djangoproject.com/en/dev/ref/models/fields/#ref-onetoone" rel="noreferrer">one-to-one relationship</a> to a model containing the fields for additional information. This one-to-one model is often called a profile model, as it might store non-auth related information about a site user.</p> </blockquote> <p>That said, extending <code>django.contrib.auth.models.User</code> and supplanting it also works...</p> <blockquote> <h2><a href="https://docs.djangoproject.com/en/dev/topics/auth/customizing/#substituting-a-custom-user-model" rel="noreferrer">Substituting a custom User model</a></h2> <p>Some kinds of projects may have authentication requirements for which Django’s built-in <code>User</code> model is not always appropriate. For instance, on some sites it makes more sense to use an email address as your identification token instead of a username.</p> <p><em>[Ed: <strong>Two warnings and a notification follow</strong>, mentioning that this is <strong>pretty drastic</strong>.]</em></p> </blockquote> <p>I would definitely stay away from changing the actual User class in your Django source tree and/or copying and altering the auth module.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload