{% load dbsetting %} var stripe = Stripe('{% dbsetting "stripe.key.public" %}'); stripe.redirectToCheckout({ sessionId: '{{ object.session }}' }).then(function (result) { alert(result.error.message); });