GithubHelp home page GithubHelp logo

sumonst21 / dj-stripe Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dj-stripe/dj-stripe

0.0 1.0 0.0 5.23 MB

Django + Stripe Made Easy

Home Page: https://dj-stripe.readthedocs.io/

License: MIT License

Python 98.98% HTML 1.02%

dj-stripe's Introduction

dj-stripe

Documentation Sponsor dj-stripe

Stripe Models for Django.

Introduction

dj-stripe implements all of the Stripe models, for Django. Set up your webhook endpoint and start receiving model updates. You will then have a copy of all the Stripe models available in Django models, as soon as they are updated!

The full documentation is available on Read the Docs.

Features

  • Stripe Core
  • Stripe Billing
  • Stripe Cards (JS v2) and Sources (JS v3)
  • Payment Methods and Payment Intents (SCA support)
  • Support for multiple accounts and API keys
  • Stripe Connect (partial support)
  • Tested with Stripe API 2020-08-27 (see API versions)

Requirements

  • Django 2.2+
  • Python 3.6+
  • PostgreSQL engine (recommended) 9.5+
  • MySQL engine: MariaDB 10.2+ or MySQL 5.7+ (Django 3.2.5+ required for MySQL 8 support)
  • SQLite: Not recommended in production. Version 3.26+ required.

Quickstart

Install dj-stripe with pip:

pip install dj-stripe

Or with Poetry (recommended):

poetry add dj-stripe

Add djstripe to your INSTALLED_APPS:

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

Add to urls.py:

path("stripe/", include("djstripe.urls", namespace="djstripe")),

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).

Add your Stripe keys and other settings:

STRIPE_LIVE_SECRET_KEY = os.environ.get("STRIPE_LIVE_SECRET_KEY", "<live secret key>")
STRIPE_TEST_SECRET_KEY = os.environ.get("STRIPE_TEST_SECRET_KEY", "<test secret key>")
STRIPE_LIVE_MODE = False  # Change to True in production
DJSTRIPE_WEBHOOK_SECRET = "whsec_xxx"  # Get it from the section in the Stripe dashboard where you added the webhook endpoint
DJSTRIPE_USE_NATIVE_JSONFIELD = True  # We recommend setting to True for new installations
DJSTRIPE_FOREIGN_KEY_TO_FIELD = "id"  # Set to `"id"` for all new 2.4+ installations

Add some payment plans via the Stripe.com dashboard.

Run the commands:

python manage.py migrate

python manage.py djstripe_sync_models

See https://dj-stripe.readthedocs.io/en/latest/stripe_elements_js/ for notes about usage of the Stripe Elements frontend JS library.

Running the Tests

Assuming the tests are run against PostgreSQL:

createdb djstripe
pytest

Changelog

See release notes on Read the Docs.

Funding this project

Stripe Logo

You can now become a sponsor to dj-stripe with GitHub Sponsors.

We've been bringing dj-stripe to the world for over 7 years and are excited to be able to start dedicating some real resources to the project.

Your sponsorship helps us keep a team of maintainers actively working to improve dj-stripe and ensure it stays up-to-date with the latest Stripe changes. If you're using dj-stripe in a commercial capacity and have the ability to start a sponsorship, we'd greatly appreciate the contribution.

All contributions through GitHub sponsors flow into our Open Collective, which holds our funds and keeps an open ledger on how donations are spent.

Similar libraries

dj-stripe's People

Contributors

jleclanche avatar kavdev avatar pydanny avatar therefromhere avatar arnav13081994 avatar lskillen avatar wahuneke avatar aleccool213 avatar pablocastellano avatar audreyfeldroy avatar philippeluickx avatar chrissmejia avatar michi88 avatar mthornhill avatar ctrengove avatar jayvdb avatar justinrporter avatar r0fls avatar dollydagr avatar jamesbrobb avatar myusuf3 avatar jameshiew avatar shvechikov avatar luismmontielg avatar areski avatar benmurden avatar czue avatar dmkoch avatar ryancausey avatar dulacp avatar

Watchers

 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.