<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Dino Perovic</title>
    <description>The latest articles on DEV Community by Dino Perovic (@dinoperovic).</description>
    <link>https://dev.to/dinoperovic</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F102297%2F141442d0-7397-48cd-af34-4f627b8973b1.jpeg</url>
      <title>DEV Community: Dino Perovic</title>
      <link>https://dev.to/dinoperovic</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dinoperovic"/>
    <language>en</language>
    <item>
      <title>Headless e-commerce framework for Django</title>
      <dc:creator>Dino Perovic</dc:creator>
      <pubDate>Wed, 16 Sep 2020 13:58:03 +0000</pubDate>
      <link>https://dev.to/dinoperovic/headless-e-commerce-framework-for-django-4akh</link>
      <guid>https://dev.to/dinoperovic/headless-e-commerce-framework-for-django-4akh</guid>
      <description>&lt;p&gt;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?&lt;/p&gt;

&lt;p&gt;I wanted a simple yet flexible system that focuses on the headless &lt;em&gt;RESTful&lt;/em&gt; 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.&lt;/p&gt;

&lt;p&gt;Don't get me wrong, there are some excellent fully-featured solutions, but none of them were simple...&lt;em&gt;at least not for me :)&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating my own
&lt;/h2&gt;

&lt;p&gt;In comes &lt;a href="https://github.com/dinoperovic/django-salesman"&gt;Salesman&lt;/a&gt;. 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.&lt;/p&gt;

&lt;p&gt;The one and only requirement for this project is &lt;a href="https://www.django-rest-framework.org"&gt;Django REST Framework&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Features
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;API endpoints for &lt;strong&gt;Basket&lt;/strong&gt;, &lt;strong&gt;Checkout&lt;/strong&gt; and &lt;strong&gt;Order&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Support for as many &lt;strong&gt;Product&lt;/strong&gt; types needed using generic relations&lt;/li&gt;
&lt;li&gt;Pluggable &lt;strong&gt;Modifier&lt;/strong&gt; system for basket processing&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Payment&lt;/strong&gt; methods interface to support any gateway necessary&lt;/li&gt;
&lt;li&gt;Customizable &lt;strong&gt;Order&lt;/strong&gt; model&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://wagtail.io/"&gt;Wagtail&lt;/a&gt; and &lt;strong&gt;Django&lt;/strong&gt; admin implementation&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Try it!
&lt;/h2&gt;

&lt;p&gt;Salesman uses &lt;a href="https://python-poetry.org/"&gt;Poetry&lt;/a&gt; for virtualenv and dependency management so you should install it first.&lt;/p&gt;

&lt;h3&gt;
  
  
  Clone the repo
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/dinoperovic/django-salesman.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Run the example
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;django-salesman/
poetry &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-E&lt;/span&gt; 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
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Done!&lt;/strong&gt; You can now:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Navigate to &lt;code&gt;/api/&lt;/code&gt; and start adding products to the basket and purchase items using &lt;em&gt;The Browsable API&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;View orders in both the regular Django admin (&lt;code&gt;/admin/&lt;/code&gt;) or &lt;a href="https://wagtail.io"&gt;Wagtail&lt;/a&gt; cms (&lt;code&gt;/cms/&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can find the full documentation on &lt;a href="https://django-salesman.readthedocs.org"&gt;Read the Docs&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;What are your experiences with building e-commerce in Django?&lt;/p&gt;

</description>
      <category>django</category>
      <category>python</category>
      <category>wagtail</category>
    </item>
  </channel>
</rss>
