Skip to content
This repository has been archived by the owner on Mar 2, 2020. It is now read-only.

Latest commit

 

History

History
118 lines (81 loc) · 3.03 KB

vm-installation-saleor.md

File metadata and controls

118 lines (81 loc) · 3.03 KB

Development installation of saleor in an Ubuntu VM

Installing postgres

  1. Install postgresql software (assuming we are using Ubuntu Bionic 18.04):
deb http://apt.postgresql.org/pub/repos/apt/ bionic-pgdg main
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt update
sudo apt install postgresql-10 postgresql-client-10 postgresql-client-common pgadmin4

You can follow this advice if you experience trouble with the deb command above. Under WSL, you will need to start the server like this:

sudo /etc/init.d/postgresql start
  1. Define a password for the postgres user, following this answer:
sudo -u postgres psql postgres

In the postgresql command-line, type

\password postgres

Once the password is set, leave that command-line with

\q
  1. Create the PostgreSQL user saleor with password saleor:
sudo -u postgres createuser --interactive --pwprompt --superuser saleor

Provide user saleor with superuser rights. Do not do that in production deployments.

  1. Create the PostgreSQL database saleor:
sudo -u postgres createdb -O saleor -e saleor

Installing Gtk+

Installing saleor

Proceed with the following steps, documented by saleor,

  1. Install the following packages:
sudo apt install build-essential python3-venv python3-dev python3-pip python3-cffi libcairo2 libpango-1.0-0 libpangocairo-1.0-0 libgdk-pixbuf2.0-0 libffi-dev shared-mime-info
pip3 install virtualenvwrapper

Following the advice, extend the ~/.bashrc file with

export WORKON_HOME=$HOME/.virtualenvs
export PROJECT_HOME=$HOME/workspace
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
export VIRTUALENVWRAPPER_VIRTUALENV=$HOME/.local/bin/virtualenv
source $HOME/.local/bin/virtualenvwrapper.sh
  1. Clone our forked saleor repository:
git clone https://github.com/softozor/saleor.git
  1. Create a virtual environment (see documentation) in the saleor repo:
cd saleor
mkvirtualenv saleor-env
  1. Install saleor requirements
pip install -r requirements.txt
  1. Add secret key to $VIRTUAL_ENV/bin/postactivate script (cf. this answer):
export SECRET_KEY=theSecretKey
  1. Prepare the database
./manage.py migrate
  1. Install frontend
npm i
npm run build-assets
npm run build-emails
  1. Run the development server:
./manage.py runserver