Skip to main content

A Django view that can be subscribed to Amazon SNS

Project description

django-sns-view2

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

This repo is a fork of the (now unmaintained) django-sns-view package (see also deep-c/django-sns-view on GitHub).

Installation

pip install django-sns-view2

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 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_view2-0.3.0.tar.gz (12.0 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_view2-0.3.0-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

Details for the file django_sns_view2-0.3.0.tar.gz.

File metadata

  • Download URL: django_sns_view2-0.3.0.tar.gz
  • Upload date:
  • Size: 12.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for django_sns_view2-0.3.0.tar.gz
Algorithm Hash digest
SHA256 3e6ba45278a49dded069a3b1dc274a9f87d2be3e796ba35c6f9e47dee33393e9
MD5 755a7382c03dd8a94141a3d8478d29a8
BLAKE2b-256 dfc278db97e63aff6345f52a1cb9e3f833bf35d78107b7e594b15b92bb4cea1d

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_sns_view2-0.3.0.tar.gz:

Publisher: .gitlab-ci.yml on thelabnyc/django-sns-view

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file django_sns_view2-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_sns_view2-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d551f5fb881cfc0fe97082ba6066cf2a23cf702cee062de8802a7d387d19d1e7
MD5 026957eff58d49bfdeaf3950fc26cdfc
BLAKE2b-256 747128e4f06b91082b9d634c57b8b468d7e4128328475273267aa474f20f15af

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_sns_view2-0.3.0-py3-none-any.whl:

Publisher: .gitlab-ci.yml on thelabnyc/django-sns-view

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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