Get it from the Cheese Shop:
pip install django-newsletter
Or get the latest & greatest from Github and link it to your
application tree:
pip install -e git://github.com/dokterbob/django-newsletter.git#egg=django-newsletter
(In either case it is recommended that you use
VirtualEnv in order to
keep your Python environment somewhat clean.)
Add newsletter and to INSTALLED_APPS in settings.py and make sure that
your favourite rich text widget (optional), some Django contrib dependencies,
sorl-thumbnail
and django-extensions
(the latter is used for the submission jobs) are there as well:
INSTALLED_APPS = (
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.auth',
'django.contrib.sites',
...
# Imperavi (or tinymce) rich text editor is optional
'imperavi',
'django_extensions',
'sorl.thumbnail',
...
'newsletter',
...
)
Install and configure your preferred rich text widget (optional).
If not set, django-newsletter will fall back to Django’s default TextField
widget:
# Using django-imperavi (make sure to update urls.py when installing this)
NEWSLETTER_RICHTEXT_WIDGET = "imperavi.widget.ImperaviWidget"
# Using django-tinymce
NEWSLETTER_RICHTEXT_WIDGET = "tinymce.widgets.TinyMCE"
Import subscription, unsubscription and archive URL’s somewhere in your
urls.py:
urlpatterns = patterns('',
...
(r'^newsletter/', include('newsletter.urls')),
...
)
Enable Django’s staticfiles
app so the admin icons, CSS and JavaScript will be available where
we expect it.
Create required data structure and load default template fixture:
./manage.py syncdb
./manage.py loaddata default_templates
Change the default contact email listed in
templates/newsletter/subscription_subscribe.html and
templates/newsletter/subscription_update.html.
Run the tests to see if it all works:
./manage.py test
If this fails, please contact me!
If it doesn’t: that’s a good sign, chap. You’ll probably have yourself a
working configuration!
Add jobs for sending out mail queues to crontab:
@hourly /path/to/my/project/manage.py runjobs hourly
@daily /path/to/my/project/manage.py runjobs daily
@weekly /path/to/my/project/manage.py runjobs weekly
@monthly /path/to/my/project/manage.py runjobs monthly