Skip to main content

A Django view that can be subscribed to Amazon SNS

Project description

Django SNS View

A drop in configurable django view that is used to subscribe and process AWS SNS messages.

Installation

pip install django-sns-view

Default Django Settings

SNS_CERT_DOMAIN_REGEX = r"sns.[a-z0-9\-]+.amazonaws.com$" # Regex to match on cert domain
SNS_VERIFY_CERTIFICATE = True # Whether to verify signature against certificate

SNSEndpoint Attributes

message_type_header = 'HTTP_X_AMZ_SNS_MESSAGE_TYPE'
topic_type_header = 'HTTP_X_AMZ_SNS_TOPIC_ARN'
allowed_message_types = ['Notification', 'SubscriptionConfirmation', 'UnsubscribeConfirmation']
cert_domain_settings_key = 'SNS_CERT_DOMAIN_REGEX'
sns_verify_settings_key = 'SNS_VERIFY_CERTIFICATE'
topic_settings_key = '' # If you would like to subscribe this endpoint to only certain topics, create a setting containing a list of topics that are allowed.

Usage

from django_sns_view.views import SNSEndpoint

class MySNSView(SNSEndpoint):
    # Can override SNSEndpoint attributes outlined above

    def handle_message(self, message, payload):
        # Process the message

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_sns_view-1.0.1.tar.gz (11.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_sns_view-1.0.1-py3-none-any.whl (14.5 kB view details)

Uploaded Python 3

File details

Details for the file django_sns_view-1.0.1.tar.gz.

File metadata

  • Download URL: django_sns_view-1.0.1.tar.gz
  • Upload date:
  • Size: 11.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.13.5 Linux/6.11.0-1015-azure

File hashes

Hashes for django_sns_view-1.0.1.tar.gz
Algorithm Hash digest
SHA256 e965072ed681ebc449f32ddb4b864fc4591179b507818889cf206becd2d19bdd
MD5 9bf5b5e56b80b3508b7466a3aa418c21
BLAKE2b-256 4f08659653b2c67db7dc0cc87ca03d3ca634c7224ab329738cbad936dbf6776d

See more details on using hashes here.

File details

Details for the file django_sns_view-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: django_sns_view-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 14.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.13.5 Linux/6.11.0-1015-azure

File hashes

Hashes for django_sns_view-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 db70b84597d1f01c287897bb5fbbb976616213b3c6b2e22493856ff0de62ade5
MD5 29f7d1f57964fa7094ae5c8e8f7ffd1a
BLAKE2b-256 ea2781d0a389aae6bcf216db22f8a50640e3049367b9eab2a9b2b801811edbdd

See more details on using hashes here.

Supported by

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