Skip to main content
https://img.shields.io/pypi/v/django-opt-out.svg https://img.shields.io/travis/wooyek/django-opt-out.svg Documentation Status Coveralls.io coverage CodeCov coverage Maintainability License Tweet about this project https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg

Allow everybody to unsubscribe your messages, user accounts are not required.

Features

  • A single page form for opt-out feedback submission

  • Feedback options text controlled from django admin

  • Predefined feedback defaults available from django manage command

  • Feedback translations done in django admin

  • Feedback options selection based on tags supplied to the opt-out url

  • Ability to preselect a feedback option

  • Ability to change selected feedback options after submission

  • Ability to set tag:value pair on opt-out url and store them on submission with user feedback

  • Signal to modify opt-out form before rendering

  • Signal on opt-out feedback submission

  • Easily overridable thank you / goodbye view

  • Opt-out form with a easily overridable base template

Demo

To run an example project for this django reusable app, click the button below and start a demo serwer on Heroku

Deploy Django Opt-out example project to Heroku Deploy Django Opt-out example project to Heroku

Quickstart

Install Django Opt-out application:

pip install django-opt-out

Add it to your INSTALLED_APPS:

INSTALLED_APPS = (
    ...
    'django_opt_out.apps.DjangoOptOutConfig',
    ...
)

Add Django Opt-out application’s URL patterns:

from django_opt_out import urls as django_opt_out_urls


urlpatterns = [
    ...
    url(r'^', include(django_opt_out_urls)),
    ...
]

Add unsubscribe links to your emails:

from django_opt_out.utils import get_opt_out_path
email='Django Opt-out <django-opt-out@niepodam.pl>'
unsubscribe = get_opt_out_path(email, 'some', 'tags', 'controlling', 'questionnaire')

# unsubscribe link will not have a domain name and scheme
# you can build prefix from request, but I prefer to set it in settings
from django.conf import settings
unsubscribe = settings.BASE_URL + unsubscribe
body = 'Hello, Regards\n\nUnsubscribe: ' + unsubscribe

from django.core import mail
message = mail.EmailMultiAlternatives(body=body, to=[email])
message.extra_headers['List-Unsubscribe'] = "<{}>".format(unsubscribe)
message.send()

Running Tests

Does the code actually work?

source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ tox

Credits

This package was created with Cookiecutter and the wooyek/cookiecutter-django-app project template.

History

0.1.0 (2017-11-03)

  • First release on PyPI.

Release files for django-opt-out 0.9.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-opt-out 0.9.4
File Size Uploaded
django-opt-out-0.9.4.tar.gz 197.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-opt-out 0.9.4
File Interpreter ABI Platform
django_opt_out-0.9.4-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 231.3 kB

Release files / django-opt-out-0.9.4.tar.gz

Download URL django-opt-out-0.9.4.tar.gz
Size 197.5 kB
Tags Source
SHA-256 checksum
How to use checksums
99d64a74de03eab0408cc4779b18b81386d1e785bf9e32d0ee633ad868ce78d7
BLAKE2b-256 checksum
How to use checksums
3de4431353adad31257a39ced88bcb5576d588e542c47cd019d25b4f69d7f617
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/3.6

Release files / django_opt_out-0.9.4-py2.py3-none-any.whl

Download URL django_opt_out-0.9.4-py2.py3-none-any.whl
Size 33.8 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
a911ab78e01b3b65c13eb1e616adf14b78887ecd05e4a20f7c6e55cd4ded4c1f
BLAKE2b-256 checksum
How to use checksums
84000c9431d70c536633c48316ab7d53b9adb996d411277a186defc3a233c53c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/3.6

Release history Release notifications | RSS feed

0.9.6

2 release files

This release

0.9.4 This release

2 release files

0.9.3

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.2.0

2 release files

0.1.17

2 release files

0.1.16

2 release files

0.1.15

2 release files

0.1.14

2 release files

0.1.13

2 release files

0.1.12

2 release files

0.1.11

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page