Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

357
Visualizações
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.

over 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda