Django 通讯应用程序

发布于 2024-08-01 21:26:28 字数 77 浏览 8 评论 0 原文

django 有没有新闻通讯应用程序,允许用户订阅或取消订阅新闻通讯? 我想要一个易于使用并通过 Django 管理员进行管理的应用程序。

Is there any newsletter app for django, allowing users to subscribe-unsubscribe for newsletters? I'd like to have an app that's easy to use and administered via the Django admin.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

棒棒糖 2024-08-08 21:26:29

尝试 djangolist

DjangoList 是一个 Django 应用程序,它将
允许进行群发邮件和管理
用户可以从中获取时事通讯
订阅/取消订阅。 DjangoList 是
目前正在开发中,尚未
准备使用。

Try djangolist

DjangoList is a django app that will
allow doing mass mailings and manage
newsletter from which users can
subscribe/unsubscribe. DjangoList is
currently under development and is not
ready to use.

风启觞 2024-08-08 21:26:29

也许,也许不是。 拥有一个在新闻通讯(但这是想象的)和订阅者(​​用户或名字/姓氏/电子邮件地址/密码上的外键)之间具有多对多关联的应用程序并不会太难。

你的模型会是这样的:

from django.db import models
from django.contrib.auth.models import User

class Subscriber(models.Model):
    user = models.ForeignKey(User)
    email = models.EmailField()

    def __unicode__(self):
        return "User %s" % (self.user.username, )

    @models.permalink
    def get_absolute_url(self):
        return ('subscriber', None, {'object_id' : self.id})

    class Meta:
        ordering = [ "id" ]

class Newsletter(models.Model):
    name = models.CharField(max_length=80)
    subscribers = models.ManyToManyField('Subscriber')
    # .... Other stuff

    def __unicode__(self):
        return "Newsletter %s" % (self.name, )

    @models.permalink
    def get_absolute_url(self):
        return ('newsletter', None, {'object_id' : self.id})

    class Meta:
        ordering = [ "id" ]

你的 urls.py 会是这样的:

from django.conf.urls.defaults import *
from django.views.generic.simple import direct_to_template

urlpatterns = patterns('',
    url(r'^subscriber/(?P<object_id>\d+)/

这足以让你继续吗?

, views.subscriberview, name='subscriber_view'), url(r'^newsletter/(?P<object_id>\d+)/

这足以让你继续吗?

', views.newsletterview,name='newsletter_view'), url(r'^site_media/(?P<path>.*)

这足以让你继续吗?

, 'django.views.static.serve', {'document_root': MEDIA_ROOT}), )

这足以让你继续吗?

Maybe, maybe not. It wouldn't be too hard to have an app that has a many-to-many association between a Newsletter (however that is imagine) and a Subscriber (foreign key on User or firstName/lastName/emailAddress/password).

Your models would be something like this:

from django.db import models
from django.contrib.auth.models import User

class Subscriber(models.Model):
    user = models.ForeignKey(User)
    email = models.EmailField()

    def __unicode__(self):
        return "User %s" % (self.user.username, )

    @models.permalink
    def get_absolute_url(self):
        return ('subscriber', None, {'object_id' : self.id})

    class Meta:
        ordering = [ "id" ]

class Newsletter(models.Model):
    name = models.CharField(max_length=80)
    subscribers = models.ManyToManyField('Subscriber')
    # .... Other stuff

    def __unicode__(self):
        return "Newsletter %s" % (self.name, )

    @models.permalink
    def get_absolute_url(self):
        return ('newsletter', None, {'object_id' : self.id})

    class Meta:
        ordering = [ "id" ]

Your urls.py would be something like this:

from django.conf.urls.defaults import *
from django.views.generic.simple import direct_to_template

urlpatterns = patterns('',
    url(r'^subscriber/(?P<object_id>\d+)/

Is that enough to get you going?

, views.subscriberview, name='subscriber_view'), url(r'^newsletter/(?P<object_id>\d+)/

Is that enough to get you going?

', views.newsletterview,name='newsletter_view'), url(r'^site_media/(?P<path>.*)

Is that enough to get you going?

, 'django.views.static.serve', {'document_root': MEDIA_ROOT}), )

Is that enough to get you going?

毁虫ゝ 2024-08-08 21:26:29

我已经发布了 Emencia Django Newsletter 的截屏演示,如果您想看看 http ://www.emencia.fr/fr/solutions/newsletter/emencia-django-newsletter

当然,它是在 github 上开源的

我们也需要在 transifex 上对翻译做出贡献

I have published a screencast demo of Emencia Django Newsletter if you want have a look http://www.emencia.fr/fr/solutions/newsletter/emencia-django-newsletter

It is of course open source on available on github

We need contribution on translation also on transifex

听风念你 2024-08-08 21:26:29

我决定创建自己的解决方案来组装文本和处理订阅,但我想我将使用 django-mailer 来跟踪发送的内容以及结果如何。

I've decided to create my own solution for assembling the text and handling subscriptions, but I think I'm going to use django-mailer to keep track of what was sent and how did it end up.

明天过后 2024-08-08 21:26:29

您可能想看看我的应用程序,简称为 django-newsletter。 它允许管理多个新闻通讯、用户订阅(他们不必提供电子邮件地址或确认任何内容,并使用数据库中的消息模板(支持文本和 HTML)。该应用程序目前正在生产使用计划在大约一周内发布 0.1 版,

对于大量提交,我建议使用 Postmark 之类的东西,它也可以与 Django 一起使用(一旦我离开,它就可以轻松地与新闻通讯应用程序一起使用)。使用 Django 的旧 (SMTP) 邮件 API 到新的与后端无关的 API,

但当然,如果您只需要简单的订阅管理,您可以使用 'github.comlashiworkdailyslash' django-newsletter 来实现这一点(是的。 ,我们是第一个使用这个名字的。:P 抱歉这个 URL - 但显然 stackoverflow 使用了某种荒谬的垃圾邮件预防机制。)

You might want to have a look at my app, simply called django-newsletter. It allows for the administration of multiple newsletters, user subscriptions (they don't have to give their email address or confirm anything and uses templates from the database for messages (with support for both text and HTML). The app is currently in production use and a 0.1 release is scheduled within about a week.

For submission of large quantities I would suggest something like Postmark, which can be used with Django as well. (This could be easily used with the newsletter app, as soon as I have moved from using Django's old (SMTP) mail API to the new backend-agnostic one.

But surely, if simple subscription management is all you need you can just use 'github.com slash howiworkdaily slash' django-newsletter which does just that. (And yes, we were first to use that name. :P Sorry about the URL - but apparently stackoverflow uses some kind of ridiculous spam prevention mechanism.)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文