- 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
- 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
- Create the PostgreSQL user
saleor
with passwordsaleor
:
sudo -u postgres createuser --interactive --pwprompt --superuser saleor
Provide user saleor
with superuser rights. Do not do that in production deployments.
- Create the PostgreSQL database
saleor
:
sudo -u postgres createdb -O saleor -e saleor
Proceed with the following steps, documented by saleor,
- 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
- Clone our forked saleor repository:
git clone https://github.com/softozor/saleor.git
- Create a virtual environment (see documentation) in the saleor repo:
cd saleor
mkvirtualenv saleor-env
- Install saleor requirements
pip install -r requirements.txt
- Add secret key to
$VIRTUAL_ENV/bin/postactivate
script (cf. this answer):
export SECRET_KEY=theSecretKey
- Prepare the database
./manage.py migrate
- Install frontend
npm i
npm run build-assets
npm run build-emails
- Run the development server:
./manage.py runserver