7👍
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+)/$', 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?
14👍
you should have a look at this project https://github.com/emencia/emencia-django-newsletter
- How to set timeout for urlfetch in Google App Engine?
- Installing django 1.5(development version) in virtualenv
- Use of unicode in Django
- Executing a Django Shell Command from the Command Line
- UnicodeEncodeError:'latin-1' codec can't encode characters in position 0-1: ordinal not in range(256)
10👍
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.)
- How can I disable a model field in a django form
- Remove padding from matplotlib plotting
- Use a django built in filter in code (outside of a template)
2👍
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
- Sending a message to a single user using django-channels
- How show personalized error with get_object_or_404
- How to manage.py loaddata in Django
- How to unit test methods inside django's class based views?
- Django makemigrations not detecting project/apps/myapp
1👍
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.
- How to display "x days ago" type time using Humanize in Django template?
- Paypal monthly subscription plan settings for first day of the month and making monthly recurring payment – django python
- Where do I import the `DoesNotExist` exception in Django 1.10 from?
- How to make follower-following system with django model
0👍
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.
- Why swagger raises unclear error – Django
- Django can't access raw_post_data
- Django-Rest-Framework serializer class meta
- Calculate point based on distance and direction