Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

274
Vistas
How to implement notification service using Django Channels in a chat application?

I am working on chat application based on django, but for real time notifications and chatting, I plan on using django channels. The problem is that apart from documentation there are hardly any resources available to get in-dept knowledge of the concepts.

Can anyone suggest a way to implement notifications in my application as when a user receives a message, he/she gets notified(using websockets concept).

Also, I plan on using channels as a way to display which of the users are currently online.

Models are as follows :

class Person(models.Model):
    user = models.OneToOneField(User)
    name = models.CharField(max_length=50)
    contact = models.CharField(max_length=12)
    online = models.IntegerField(default=0)

    def __str__(self):
        return self.name

class Dialog(models.Model):
    author = models.ForeignKey(Person,related_name="self")
    reader = models.ForeignKey(Person)

    def __str__(self):
        return self.author.name + " - " + self.reader.name

class Message(models.Model):
    dialog = models.ForeignKey(Dialog)
    sender = models.ForeignKey(Person)
    text = models.TextField()

    def __str__(self):
        return self.sender.name + " : " + self.text

I have been stuck with this problem for a while now. I would be grateful if anyone can suggest a solution.

Thanks in advance.

about 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda