Skip to main content

No project description provided

Project description

django-ses-sns-tracker

A simple wrapper around django-ses to receive and persist sns event data.

Records mail delivery in the SESMailDelivery model and updates the state if a matching SNS notification is received.

Requirements

Quick start

  1. Add ses_sns_tracker to your INSTALLED_APPS setting like this:

    INSTALLED_APPS = [
        ...
        'ses_sns_tracker',
    ]
    
  2. Run python manage.py migrate to create the models.

  3. Setup django-ses

  4. (Optional) Use ses_sns_tracker.backends.SESSNSTrackerBackend as your default email backend:

    EMAIL_BACKEND = 'ses_sns_tracker.backends.SESSNSTrackerBackend'
    

    This way all emails will be send via the Amazon SES API.

  5. (Optional) Send an email via the SESMailDelivery manager (doesn't require SESSNSTrackerBackend as the default mail backend):

    from django.core.mail import EmailMessage
    from ses_sns_tracker.models import SESMailDelivery
    
    message = EmailMessage(
        subject='email subject',
        body='email body',
        from_email='from@example.org',
        to=['recipient@example.org'],
    )
    SESMailDelivery.objects.create_message(message, fail_silently=False, fake_delivery=False)
    

Settings

  • SES_SNS_TRACKER_DEBUG_BACKEND = 'django.core.mail.backends.console.EmailBackend'

    Set mail backend to use for the actual mail delivery in DEBUG mode (SESMailDelivery objects will still be created). Default: None

  • SES_SNS_TRACKER_USE_CRYPTOGRAPHY = True

    Use crypthography instead of M2Crypto to verify the signature of messages received from SNS. Default: True

Development setup

  1. Upgrade packaging tools:

    pip install --upgrade pip setuptools wheel
    
  2. Install packages from requirements-dev.txt:

    pip install -r requirements-dev.txt
    
  3. (Optional) Override settings in example_proj/settings_local.py & tests/settings_local.py as required.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-ses-sns-tracker-1.1.2.tar.gz (6.7 kB view details)

Uploaded Source

File details

Details for the file django-ses-sns-tracker-1.1.2.tar.gz.

File metadata

  • Download URL: django-ses-sns-tracker-1.1.2.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.6

File hashes

Hashes for django-ses-sns-tracker-1.1.2.tar.gz
Algorithm Hash digest
SHA256 4cb92a4ec043fa2d9f45be269a8a58b3e8a7dce98433a940cf0bfe1f851b6d89
MD5 6c4fc28d1afb5dd66d6fa9207fd526a7
BLAKE2b-256 d210caafc717ebbc34a3c53300013e8d05e9ecf5952a66870f83966152ad33c9

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page