Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7011367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:07:04+00:00 2026-05-27T22:07:04+00:00

I have been developing in django for sometime now, and have developed a neat

  • 0

I have been developing in django for sometime now, and have developed a neat website having functionality such as writing blogs, posting questions, sharing content etc. However there is still one thing that is missing and i.e. creating notification for users.

What I want to do is to inform users in their profiles, whenever somebody comments on their posts, or if they are following a particular post and there is an update on it, then inform the user of that update. I have looked around many applications but I am still very confused about how to do it.

In case of using django-notification I seem to have an impression(which can be wrong) that I can use this only to inform the user via email, i.e. I cannot show these notifications in the user profile, just like we have on facebook.

Firstly I would like to know if I am wrong, and then I really need some proper tutorial or guidance on how to go about doing it. I know how to register a notification and send it on proper signal but there is no documentation on how to show these notices in a template, if this can be done.

Any guidance/tutorial/getting started doc will be deeply appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T22:07:05+00:00Added an answer on May 27, 2026 at 10:07 pm

    Yes django-notifications is only designed for email notifications.

    Here is a signal slot that you can add to your models.py and tweak to your own needs:

    from django.db import models
    from django.contrib.sites.models import Site
    from django.db.models import signals
    from notification import models as notification
    
    def create_notice_types(app, created_models, verbosity, **kwargs):
        notification.create_notice_type("new_comment", "Comment posted", "A comment has been posted")
    signals.post_syncdb.connect(create_notice_types, sender=notification)
    
    def new_comment(sender, instance, created, **kwargs):
        # remove this if-block if you want notifications for comment edit too
        if not created:
            return None
    
        context = {
            'comment': instance,
            'site': Site.objects.get_current(),
        }
        recipients = []
    
        # add all users who commented the same object to recipients
        for comment in instance.__class__.objects.for_model(instance.content_object):
            if comment.user not in recipients and comment.user != instance.user:
                recipients.append(comment.user)
    
        # if the commented object is a user then notify him as well
        if isinstance(instance.content_object, models.get_model('auth', 'User')):
            # if he his the one who posts the comment then don't add him to recipients
            if instance.content_object != instance.user and instance.content_object not in recipients:
                recipients.append(instance.content_object)
    
        notification.send(recipients, 'new_comment', context)
    
    signals.post_save.connect(new_comment, sender=models.get_model('comments', 'Comment'))
    

    Now for templates, pretty easy.

    templates/notification/new_comment/short.txt

    {{ comment.user }} commented on {{ comment.object }}
    

    templates/notification/new_comment/notice.html

    <a href="{{ comment.user.get_absolute_url }}">{{ comment.user }}</a> commented <a href="{{ comment.content_object.get_absolute_url }}">{{ comment.content_object }}</a>
    

    templates/notification/new_comment/full.txt

    {{ comment.user }} commented on {{ comment.content_object }}
    
    Comment:
    {{ comment.comment }}
    
    Reply on: 
    http://{{ site.domain }}{{ comment.content_object.get_absolute_url }}
    

    Warning: it’s a very simplified, untested adaptation of our production code.

    Note : Django-1.7 deprecated the post_syncdb signal

    Here are some more information:

    • documentation
    • a blog post by stringfellow
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been developing an app in FatFree framework and now I am trying
I've recently been developing on the django platform and have stumbled upon Django Forms
I have been developing some Django app and there's some duplicated code for different
I have been developing websites for a couple of years now and I almost
I've been developing in my own django environment for a while now using the
I am developing my first django website. I have written code in my view
I've been now happily developing applications (Django in particular) on the Mac for a
I have been developing an application with django and elementtree and while deploying it
I have been developing with cappuccino for a while now and all of a
I have been developing .NET applications for two years and now I want to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.