eCommerce website with Django and Stripe integration

Ramsharan Kanwar
2 min readJun 8, 2022


A sample ecommerce website with payment integration.

The source code can be found here.

Stripe integration

You may add/remove products to/from cart, place orders or search for items using the search bar. You may create accounts using the Sign Up button or log in using the Sign In button. You may view the product details by clicking the product itself. Products can be created using the admin panel that can be reached using https://localhost:8000/admin

This project allows users to create accounts and log in, add products to cart and then buy them via stripe. It keeps track of order history and allows users to review the order by giving it ratings and a text-review, which can be seen on every product detail page along with other reviews.

Basic Commands

Setting Up Your Users

  • To create a normal user account, just go to Sign Up and fill out the form. Once you submit it, you’ll see a “Verify Your E-mail Address” page. Go to your console to see a simulated email verification message. Copy the link into your browser. Now the user’s email should be verified and ready to go.
  • To create a superuser account, use this command:

$ python createsuperuser

For convenience, you can keep your normal user logged in on Chrome and your superuser logged in on Firefox (or similar), so that you can see how the site behaves for both kinds of users.

Type checks

Running type checks with mypy:

$ mypy ecom

Test coverage

To run the tests, check your test coverage, and generate an HTML coverage report:

$ coverage run -m pytest
$ coverage html
$ open htmlcov/index.html

Running tests with pytest

$ pytest

Live reloading and Sass CSS compilation

Moved to Live reloading and SASS compilation.



Ramsharan Kanwar

An independent journalist and writer.