Answer the question
In order to leave comments, you need to log in
How to create custom user model in django?
How to create a model of a user who, when registering, needs to specify a login, password, as well as the login of the person who invited (autocomplete from the column in the table)? How is it better to implement authentication - through the admin panel or create a separate page for ordinary "mortal" users? Why?
Answer the question
In order to leave comments, you need to log in
In the new jang, you can customize the user model.
Ask Google moderators to remove your search ban.
A concise retelling, given that you are creating an application from scratch, and not migrating from a created application with a ready-made base and users:
class Article(models.Model):
author = models.ForeignKey(settings.AUTH_USER_MODEL)
def post_save_receiver(signal, sender, instance, **kwargs):
pass
post_save.connect(post_save_receiver, sender=settings.AUTH_USER_MODEL)
class MyUser(AbstractBaseUser):
identifier = models.CharField(max_length=40, unique=True)
...
USERNAME_FIELD = 'identifier'
class MyUser(AbstractBaseUser):
...
date_of_birth = models.DateField()
height = models.FloatField()
...
REQUIRED_FIELDS = ['date_of_birth', 'height']
www.lasolution.be/blog/creating-custom-user-model-...
here look at the last example to register a new model in the admin panel: djbook.ru/examples/6
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question