[Answer]-Create friends list between users in django web application

1👍

✅

Probably the simplest way to achieve this is to implement a model which extends the functionality of built-in django user model. The sketch is below

from django.db import models
from django.contrib.auth.models import User

class MyUser(models.Model):
    user = models.OneToOneField(User)
    friends = models.ManyToManyField(User) # you can also define this relationship to MyUser

Leave a comment