开发者

How to syndicate comments subscriptions in Django

I have been trying to search for the right way to go about creating a "subscribe to comments feeds" with an email subscription, seen on many blog. I have got an RSS feed working, but would prefer to use a cleaner email subscription.

What is the right way to go about this. Should I create a new class in the models.py file to create new database tables to handle it, or is it better to use third party applications? I prefer to keep from using things like Intense Debate. I want to keep it Django as much as possible.

开发者_StackOverflow中文版

I am assuming that this is already available in Django?

Basically, I want to create something like the "Notify .... daily of new answers" bit at the bottom of this page as I write this question.

Edit: I wonder if I should be trying to use signals to do this with?


You might want to use the django-notification app. It's a nice reusable application that let you define events that will trigger specific notifications and you can specify how the notification will be sent, e.g. by mail in your example.

But this is maybe not what you want since there is no way to send only one email per day with all the new posts created.

So my suggestion is:

  • Create a new simple app that stores the subscribers with their details about how often they want to receive updates etc.
  • Then create a management command that sends emails of new posts and dependent of the settings of your subscribers.
  • Make a cronjob (or use celery) to trigger this view every day.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜