[Fixed]-Django Newsletter App


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, )

    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, )

    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+)/$', 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}),

Is that enough to get you going?


you should have a look at this project https://github.com/emencia/emencia-django-newsletter


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. 😛 Sorry about the URL – but apparently stackoverflow uses some kind of ridiculous spam prevention mechanism.)


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


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.



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.

Leave a comment