Link: https://youtu.be/7om_bC6I7zY
-
Add your Stripe secret and publishable keys to the settings.py file:
STRIPE_PUBLISHABLE_KEY = '<your test publishable key here>' STRIPE_SECRET_KEY = '<your test secret key here>'
-
Add the webhook endpoint secret from Stripe to the settings.py file:
STRIPE_ENDPOINT_SECRET = '<your endpoint secret here>'
-
Change "DEBUG" to False and add the production site to "ALLOWED_HOSTS" in the settings.py file:
DEBUG = True ALLOWED_HOSTS = []
-
Edit product information in the views.py file:
line_items=[{ 'price_data': { 'currency': 'usd', 'unit_amount': '3000', 'product_data': { 'name': 'Sneakers', } }, 'quantity': 1, }],
-
Install the requirements:
(venv)$ pip install -r requirements.txt
-
Apply the migrations:
(venv)$ python manage.py migrate
-
Run the server:
(venv)$ python manage.py runserver