How to use the sparkpost.US_API function in sparkpost

To help you get started, we’ve selected a few sparkpost examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github SparkPost / python-sparkpost / test / django / test_email_backend.py View on Github external
def test_default_base_uri_retrieval():
    backend = SparkPostEmailBackend()
    assert backend.client.base_uri.startswith('https://' + US_API)
github SparkPost / python-sparkpost / sparkpost / django / email_backend.py View on Github external
def __init__(self, fail_silently=False, **kwargs):
        super(SparkPostEmailBackend, self)\
            .__init__(fail_silently=fail_silently, **kwargs)

        sp_api_key = getattr(settings, 'SPARKPOST_API_KEY', None)
        sp_base_uri = getattr(settings, 'SPARKPOST_BASE_URI', US_API)

        self.client = SparkPost(sp_api_key, sp_base_uri)