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.0.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.0-py3-none-any.whl (14.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: django_sns_view-1.0.0.tar.gz
  • Upload date:
  • Size: 11.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.13.2 Linux/6.8.0-1021-azure

File hashes

Hashes for django_sns_view-1.0.0.tar.gz
Algorithm Hash digest
SHA256 9fd281bee6e138dd32dbf4394b28dc7be2bf8f3f29adab7041eddc3f88836ae1
MD5 17f3d86473dd7ddfa927d2100ca41d0c
BLAKE2b-256 1616f7e8a6b280057efbff4cf2ae230414420c705efe8bbf1b139b6723d04b4f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: django_sns_view-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 14.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.13.2 Linux/6.8.0-1021-azure

File hashes

Hashes for django_sns_view-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d0a7ef1a0a6c2979b1f0b5f7ba6bb7437b3a0fadbc683e433b4ce6895f707882
MD5 b899c39dae1a2c9db8a97df16ee5166b
BLAKE2b-256 d5b42e40ae2e7efc6628ce4930c8b2417f025c6e9076c22c29e57dce35912c29

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