Get the distribution

At the command line:

$ pip install dj-stripe

Or, if you have virtualenvwrapper installed:

$ mkvirtualenv dj-stripe
$ pip install dj-stripe

Or, if you want to develop on djstripe itself:

$ git clone<yourname>/dj-stripe/
$ python develop


Add djstripe to your INSTALLED_APPS:


Add your stripe keys:

STRIPE_PUBLIC_KEY = os.environ.get("STRIPE_PUBLIC_KEY", "<your publishable key>")
STRIPE_SECRET_KEY = os.environ.get("STRIPE_SECRET_KEY", "<your secret key>")

Add some payment plans:

    "monthly": {
        "stripe_plan_id": "pro-monthly",
        "name": "Web App Pro ($25/month)",
        "description": "The monthly subscription plan to WebApp",
        "price": 2500,  # $25.00
        "currency": "usd",
        "interval": "month"
    "yearly": {
        "stripe_plan_id": "pro-yearly",
        "name": "Web App Pro ($199/year)",
        "description": "The annual subscription plan to WebApp",
        "price": 19900,  # $199.00
        "currency": "usd",
        "interval": "year"


Stripe Plan creation

Not all properties listed in the plans above are used by Stripe - i.e ‘description’, which is used to display the plans description within specific templates.

Although any arbitrary property you require can be added to each plan listed in DJ_STRIPE_PLANS, only specific properties are used by Stripe. The full list of required and optional arguments can be found here.


The display order of the plans

If you prefer the plans to appear (in views) in the order given in the DJSTRIPE_PLANS setting, use an OrderedDict from the collections module in the standard library, rather than an ordinary dict.

Add to the

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

Run the commands:

python migrate

python djstripe_init_customers

python djstripe_init_plans

If you haven’t already, add JQuery and the Bootstrap 3.0.0+ JS and CSS to your base template:

<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="">

<!-- Optional theme -->
<link rel="stylesheet" href="">

<!-- Latest JQuery (IE9+) -->
<script src="//"></script>

<!-- Latest compiled and minified JavaScript -->
<script src=""></script>

Also, if you don’t have it already, add a javascript block to your base.html file:

{% block javascript %}{% endblock %}

Running Tests

Assuming the tests are run against PostgreSQL:

createdb djstripe
pip install -r requirements_test.txt