Get the distribution

At the command line:

$ pip install dj-stripe


Add djstripe to your INSTALLED_APPS:

    # ...,

Add your Stripe keys and set the operating mode:

STRIPE_LIVE_PUBLIC_KEY = os.environ.get("STRIPE_LIVE_PUBLIC_KEY", "<your publishable key>")
STRIPE_LIVE_SECRET_KEY = os.environ.get("STRIPE_LIVE_SECRET_KEY", "<your secret key>")
STRIPE_TEST_PUBLIC_KEY = os.environ.get("STRIPE_TEST_PUBLIC_KEY", "<your publishable key>")
STRIPE_TEST_SECRET_KEY = os.environ.get("STRIPE_TEST_SECRET_KEY", "<your secret key>")
STRIPE_LIVE_MODE = <True or False>

Add some payment plans via the dashboard or the django ORM.

Add the following to the urlpatterns in your to expose the webhook endpoint:

url(r"^stripe/", include("djstripe.urls", namespace="djstripe")),

Then tell Stripe about the webhook (Stripe webhook docs can be found here) using the full URL of your endpoint from the step above (e.g.

Run the commands:

python migrate

python djstripe_init_customers

Running Tests

Assuming the tests are run against PostgreSQL:

createdb djstripe