Code Monkey home page Code Monkey logo

dj-stripe's Introduction

dj-stripe

Build Status

Stripe Models for Django.

Introduction

dj-stripe implements all of the Stripe models, for Django. Set up your webhook and start receiving model updates. You will then have a copy of all the Stripe models available in Django models, no API traffic required!

The full documentation is available here: https://dj-stripe.readthedocs.io/

Features

  • Subscriptions
  • Individual charges
  • Stripe Sources
  • Stripe v2 and v3 support
  • Supports Stripe API 2018-05-21

Requirements

  • Django >= 2.0
  • Python >= 3.4
  • Supports Stripe exclusively. For PayPal, see dj-paypal instead.

Quickstart

Install dj-stripe:

pip install dj-stripe

Add djstripe to your INSTALLED_APPS:

INSTALLED_APPS =(
    ...
    "djstripe",
    ...
)

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 = False  # Change to True in production

Add some payment plans via the Stripe.com dashboard.

Add to urls.py:

path("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 urls.py step above (e.g. https://example.com/stripe/webhook).

Run the commands:

python manage.py migrate

python manage.py djstripe_init_customers

python manage.py djstripe_sync_plans_from_stripe

Running the Tests

Assuming the tests are run against PostgreSQL:

createdb djstripe
pip install tox
tox

Follows Best Practices

This project follows best practices as espoused in Two Scoops of Django: Best Practices for Django 1.11.

dj-stripe's People

Contributors

kavdev avatar jleclanche avatar pydanny avatar lskillen avatar wahuneke avatar aleccool213 avatar audreyfeldroy avatar philippeluickx avatar chrissmejia avatar michi88 avatar mthornhill avatar ctrengove avatar justinrporter avatar jamesbrobb avatar dollydagr avatar r0fls avatar myusuf3 avatar jameshiew avatar shvechikov avatar luismmontielg avatar areski avatar benmurden avatar nigma avatar dmkoch avatar yprez avatar sunliwen avatar scream4ik avatar nickdjones avatar jpadilla avatar jamezpolley avatar

Watchers

alekseev avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.