Skip to main content

A Django view that can be subscribed to Amazon SNS

Project description

.. image::

Django SNS View

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


.. code-block:: python

pip install django-sns-view

Default Django Settings
.. code-block:: python

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

SNSEndpoint Attributes
.. code-block:: python

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.

.. code-block:: python

from django-sns-view.views import SNSEndpoint

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

def handle_message(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-0.1.1.tar.gz (10.6 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page