Answer the question
In order to leave comments, you need to log in
How to make an extended user model?
Good day, gentlemen. Can you please tell me how to register users using the Django rest framework, but with an extended model?
Here, for example, I have a UserProfile model that has a field
class UserProfile(models.Model):
user = models.OneToOneField(User, related_name='profile')
city = models.CharField(max_length=255)
Answer the question
In order to leave comments, you need to log in
It is very convenient to change the logic of creating and editing objects through serializers . But in general, it seems to me that a more correct way is to transfer the city field to the user model, since 3 major versions of jang can do this out of the box .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question