Whilst moving to the headless way of building the web I encountered the dilema — which solution to use to build e-commerce stores in Django?
I wanted a simple yet flexible system that focuses on the headless RESTful approach and while there are many solutions in the wild, each had me reading through the docs and code for hours trying to figure out where to start, how to extend, how to integrate with existent projects, etc.
Don't get me wrong, there are some excellent fully-featured solutions, but none of them were simple...at least not for me :)
In comes Salesman. I've created a small framework for building headless e-commerce. The idea was to make it as simple as possible for a beginner Django developer to pick up and get started, but also allow for advanced features to be added progressively.
The one and only requirement for this project is Django REST Framework.
- API endpoints for Basket, Checkout and Order
- Support for as many Product types needed using generic relations
- Pluggable Modifier system for basket processing
- Payment methods interface to support any gateway necessary
- Customizable Order model
- Wagtail and Django admin implementation
Salesman uses Poetry for virtualenv and dependency management so you should install it first.
git clone https://github.com/dinoperovic/django-salesman.git
cd django-salesman/ poetry install -E example poetry run example/manage.py migrate poetry run example/manage.py create_dummy_products poetry run example/manage.py createsuperuser poetry run example/manage.py runserver
Done! You can now:
- Navigate to
/api/and start adding products to the basket and purchase items using The Browsable API.
- View orders in both the regular Django admin (
/admin/) or Wagtail cms (
You can find the full documentation on Read the Docs.
What are your experiences with building e-commerce in Django?