Install Saleor e-commerce

Posted by Toguko on Tue 12 September 2017

I decide to create one e-commerce to sell my wife artisan's products directly and stop to depends on third party platforms that take a big part of the earns.

We are fu***ed in terms of an Open Source e-commerce platform written in Python + Django. We have many options, but this options or are abandoned, or is not easy to set up, or are not easy to customize, or don't have a good and updated documentation.

I choose Saleor after days looking for a good and easy to use Python + Django e-commerce and not find one. Saleor was the easiest to install, even with a very bad and old documentation. So let's go over by one step-by-step how to install locally, setting up and deploy the app at Heroku. After these steps I will try to adapt to the Brazilian Environment like Payment options, Shipping Cost, etc.

To start, let's check our npm and yarn versions, Saleor uses npm version 6.x and yarn 0.20.x

To easily switch between npm versions we'll use NVM. NVM.

Installing NVM dependencies:

$sudo apt-get update
$sudo apt-get install build-essential libssl-dev

Downloading the NVM install script and Installing it:

$curl -sL -o

List the npm versions available:

$nvm ls-remote

->  v6.9.0

Now install the version to be used with Saleor:

$nvm install 6.0.0
$nvm use 6.0.0
$node -v

If you have several Nodejs versions, you can see which version are installing using this command:

$nvm ls

Now clone the Saleor app, and the Python Virtual Env:

$git clone MYAPP
$python3 -m venv .venv
$source .venv/bin/activate
$pip install pip --upgrade
$pip install -r requirements.txt

Debian and Ubuntu users who install Node.js using system packages, will need to install the nodejs-legacy package as well. $sudo apt-get install nodejs-legacy

Install Webpack Module Bundler and Yarn globally with:

$npm i webpack -g
$npm i yarn -g

Install PostgreSQL version 9.4 or above following this tutorial of Digital Ocean Don't forget to set the user and password of the postgress user that you create in the at the line bellow:

    'default': dj_database_url.config(

The original docs ask you to create a variable at your environment with $ export SECRET_KEY='<mysecretkey>'. I'll not do this, I'm putting the SECRET_KEY directly at at this time because in the near future I'll use the python-decouple to do a full separation of the config files. So, with you want to do this, go to you comment the line below:

# SECRET_KEY = os.environ.get('SECRET_KEY') # Original Saleor SECRET_KEY Config


Prepare the database:

$python makemigrations
$python migrate

Now everything with the Django and Database is fine, and began my nightmares with the frontend parts... Let's install the front-end dependencies with:


I received this error:

yarn install v1.0.1
[1/5] Validating package.json...
error saleor@0.0.0: The engine "yarn" is incompatible with this module. Expected version "0.20.x".
error Found incompatible module
info Visit for documentation about this command.

I decide to go at package.json file and remove the version of the package yarn of "yarn": "0.20.x" to "yarn": "", save and run yarn again. Everything was installed without problems, only one warning warning "ajv-keywords@1.5.0" has incorrect peer dependency "ajv@>=4.10.0". that I decide to check later.

Now lets prepare front-end assets with:

$yarn run build-assets

Everything was ok, but with a lot of warnings to check later...

Now Run python populatedb to populate the database, so we can test the app with some images and contents.

And finally we reach our goal, let's test with: python runserver

Open a web browser at localhost:8000 to check your new Saleor e-commerce up and running.

In the next post, I will show how to deploy the app at Heroku.