django-notification

Adding custom field to django-notifications always returning none on notify.send()

China☆狼群 提交于 2021-01-29 21:02:16
问题 I am trying to add a new field to the Notification model in django-notifications-hq. Currently in my main/models.py i have: class Notification(AbstractNotification): # custom field example unique_uuid = models.CharField(max_length=255,unique=True, null=True) class Meta(AbstractNotification.Meta): abstract = False app_label = 'main' Now in my settings.py file I have: NOTIFICATIONS_NOTIFICATION_MODEL = 'main.Notification' NOTIFICATIONS_USE_JSONFIELD=True I am trying to generate a notification

Adding custom field to django-notifications always returning none on notify.send()

十年热恋 提交于 2021-01-29 18:31:29
问题 I am trying to add a new field to the Notification model in django-notifications-hq. Currently in my main/models.py i have: class Notification(AbstractNotification): # custom field example unique_uuid = models.CharField(max_length=255,unique=True, null=True) class Meta(AbstractNotification.Meta): abstract = False app_label = 'main' Now in my settings.py file I have: NOTIFICATIONS_NOTIFICATION_MODEL = 'main.Notification' NOTIFICATIONS_USE_JSONFIELD=True I am trying to generate a notification

Sending Bulk email in Django

跟風遠走 提交于 2020-01-23 11:58:45
问题 I have to send bulk email in django, the email template will be will be customized and the some data in the template will be coming from db. i twas using django notification but it can only send email to the registered users. I have to send emails to the non-registered users. there will be five email template the user can select any one and the email has to be sent. For ex. An invitation to the event to the group of non-registered users. user will enter email ids, and will do a bulk send.

Sending Bulk email in Django

南楼画角 提交于 2020-01-23 11:58:19
问题 I have to send bulk email in django, the email template will be will be customized and the some data in the template will be coming from db. i twas using django notification but it can only send email to the registered users. I have to send emails to the non-registered users. there will be five email template the user can select any one and the email has to be sent. For ex. An invitation to the event to the group of non-registered users. user will enter email ids, and will do a bulk send.

Periodically fetch data and display it with Django

落花浮王杯 提交于 2020-01-03 01:55:21
问题 I would like to implement a kind of "real-time" notification system in my Django application. I would store some messages destined to a specific user in my database. When a user is logged in the application, if there is a notification for him in the database, then the application displays it using the messages framework. When he clicks on the message, it is deleted from the database. I am a bit stuck on the "fetch the data every minute" thing. I heard of celery (http://docs.celeryproject.org

django-notifications: how NOTIFICATIONS_SOFT_DELETE=True works?

陌路散爱 提交于 2019-12-11 13:59:07
问题 I want a notification system for my app, so I was looking into a django package called django-notifications. I understood all of it but NOTIFICATION_SOFT_DELETE=True settings. I mean when I do the following: from notifications import notify notify.send(user, recipient=user, verb='you reached level 10') This will make an entry to the database with deleted=False if I am not wrong. I have the following in my settings.py : NOTIFICATIONS_SOFT_DELETE=True which updates to deleted=False to deleted

How do I display notifications from `django-notification`?

别来无恙 提交于 2019-12-03 03:58:52
问题 I've been reading the docs for django-notification, and they seem to cover creating notifications just fine, but not how to display them to users. Is there a good reference for this out there, and my Google-fu has just failed me? If not, can someone give me some pointers here? Thanks. 回答1: The answer is you have to build it into your own templates. This can be as simple as the following snippet: <table> <caption>{% trans "Notices" %}</caption> <thead> <tr> <th>{% trans "Type" %}</th> <th>{%

How do I display notifications from `django-notification`?

别来无恙 提交于 2019-12-02 17:20:56
I've been reading the docs for django-notification , and they seem to cover creating notifications just fine, but not how to display them to users. Is there a good reference for this out there, and my Google-fu has just failed me? If not, can someone give me some pointers here? Thanks. Hank Gay The answer is you have to build it into your own templates. This can be as simple as the following snippet: <table> <caption>{% trans "Notices" %}</caption> <thead> <tr> <th>{% trans "Type" %}</th> <th>{% trans "Message" %}</th> <th>{% trans "Date of the Notice" %}</th> </tr> </thead> <tbody> {% for

How to use django-notification to inform a user when somebody comments on their post

好久不见. 提交于 2019-11-28 19:43:08
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

Django - How to track if a user is online/offline in realtime?

馋奶兔 提交于 2019-11-28 19:40:46
I'm considering to use django-notifications and Web Sockets to send real-time notifications to iOS/Android and Web apps. So I'll probably use Django Channels . Can I use Django Channels to track online status of an user real-time? If yes then how I can achieve this without polling constantly the server? I'm looking for a best practice since I wasn't able to find any proper solution. UPDATE : What I have tried so far is the following approach: Using Django Channels, I implemented a WebSocket consumer that on connect will set the user status to 'online' , while when the socket get disconnected