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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for django_sns_view2-0.3.2.tar.gz
Algorithm Hash digest
SHA256 03f85dfd017e71f3c6070b96cfb1c408640fda47cbf58cb6128bc7092d859bbf
MD5 1b524bf4f0f31b84ce9b5fff7aa0071f
BLAKE2b-256 689bacb35f1979a6202f6bf442eab31784b0296137e60543606de7fc3d1b42f0

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_sns_view2-0.3.2.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.2-py3-none-any.whl.

File metadata

File hashes

Hashes for django_sns_view2-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2853a42ff63252fd7c32522b880f86d91fc58a565291dea132daa76b7ef2ce1c
MD5 9b1c77c162ce0f8e4299cb60817da14a
BLAKE2b-256 984d9706efac68e06b74aa9119a0573836cdcecc43d3d0c5f08c21e8c00fc460

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_sns_view2-0.3.2-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