I have a simple Django app with a model called Person:
class Person(models.Model):
user = models.ForeignKey(
settings.AUTH_USER_MODEL,
on_delete=models.CASCADE
)
birthday = models.DateField(null=True)
gender = models.CharField(max_length=10)
height = models.CharField(max_length=3)
weight = models.CharField(max_length=3)
I have also a User -model like this:
from django.contrib.auth.models import AbstractUser
class CustomUser(AbstractUser):
pass
# add additional fields in here
def __str__(self):
return self.username
I can log in in the admin panel and create new users from there and link my Person -model with a User. What I'm wondering is how can I define for example register/ and login/ routes so I could for example register a new user with Postman? How about authentication, could someone give a simple example how to serve right data to right users?