Skip to content

Mercor-Projects/djangostripeSolution

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

djangostripe

Video Demonstration

Link: https://youtu.be/7om_bC6I7zY

Necessary Modifications

  1. 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>'
  2. Add the webhook endpoint secret from Stripe to the settings.py file:

    STRIPE_ENDPOINT_SECRET = '<your endpoint secret here>'
  3. Change "DEBUG" to False and add the production site to "ALLOWED_HOSTS" in the settings.py file:

    DEBUG = True
    
    ALLOWED_HOSTS = []
  4. Edit product information in the views.py file:

    line_items=[{
                    
        'price_data': {
            'currency': 'usd',
            'unit_amount': '3000',
            'product_data': {
                'name': 'Sneakers',
            }
        },
    
        'quantity': 1,
    
    }],

Run the Solution Locally

  1. Install the requirements:

    (venv)$ pip install -r requirements.txt
  2. Apply the migrations:

    (venv)$ python manage.py migrate
  3. Run the server:

    (venv)$ python manage.py runserver

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published