I am using Django contrib.comments and want to know the following.
Are there any utilities or applications that can be connected to the application that sends you a notification when a comment is sent on an item?
I didn’t work very much with signals, so please be a little descriptive.
Here is what I came up with.
from django.contrib.comments.signals import comment_was_posted
from django.core.mail import send_mail
if "notification" in settings.INSTALLED_APPS:
from notification import models as notification
def comment_notification(request):
user = request.user
message = "123"
notification.send([user], "new comment", {'message': message,})
comment_was_posted.connect(comment_notification)
ApPeL source
share