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

Uploaded Python 3

File details

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

File metadata

  • Download URL: django_sns_view2-0.2.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.2.0.tar.gz
Algorithm Hash digest
SHA256 d9a2085ccc263d0e705c8f1ef3c675a36ce38a39b0e1369b4435d3144af1307c
MD5 8d5da5f02986787d314b42450b50d90d
BLAKE2b-256 d491845320311ce5b014cdbd0b72b6f407b9cafd192c903a9e2f444eee268ab3

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for django_sns_view2-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0c0312748fb05b2e714760f7b234c9f0545287f8eb37653fe74782c22097d0a0
MD5 56fc986ae6f301ad16a28bf45631e9fa
BLAKE2b-256 3a952b245528cc7fbc3ae3fd058934ef6ea133d1bab38a780fed8baf8b9be9c2

See more details on using hashes here.

Provenance

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