Installation for macOS¶
Prerequisites¶
Before you are ready to run Saleor you will need additional software installed on your computer.
Node.js¶
Version 10 or later is required. Download the macOS installer from the Node.js downloads page.
PostgreSQL¶
Saleor needs PostgreSQL version 9.4 or above to work. Get the macOS installer from the PostgreSQL download page.
Command Line Tools for Xcode¶
Download and install the latest version of “Command Line Tools (macOS 10.x) for Xcode 9.x” from the Downloads for Apple Developers page.
Then run:
$ xcode-select --install
Homebrew¶
Run the following command:
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Gtk+¶
Use Homebrew to install the graphical libraries necessary for PDF creation:
$ brew install cairo pango gdk-pixbuf libffi
Installation¶
Clone the repository (or use your own fork):
$ git clone https://github.com/mirumee/saleor.gitEnter the directory:
$ cd saleor/
Install all dependencies:
We strongly recommend creating a virtual environment before installing any Python packages.
$ pip install -r requirements.txtSet
SECRET_KEYenvironment variable.We try to provide usable default values for all of the settings. We’ve decided not to provide a default for
SECRET_KEYas we fear someone would inevitably ship a project with the default value left in code.$ export SECRET_KEY='<mysecretkey>'
Warning
Secret key should be a unique string only your team knows. Running code with a known
SECRET_KEYdefeats many of Django’s security protections, and can lead to privilege escalation and remote code execution vulnerabilities. Consult Django’s documentation for details.Create a PostgreSQL user:
Unless configured otherwise the store will use
saleoras both username and password. Remember to give your user theSUPERUSERprivilege so it can create databases and database extensions.$ createuser --superuser --pwprompt saleorEnter
saleorwhen prompted for password.Create a PostgreSQL database:
Unless configured otherwise the store will use
saleoras the database name.$ createdb saleorPrepare the database:
$ python manage.py migrateWarning
This command will need to be able to create database extensions. If you get an error related to the
CREATE EXTENSIONcommand please review the notes from the user creation step.Install front-end dependencies:
$ npm installNote
If this step fails go back and make sure you’re using new enough version of Node.js.
Prepare front-end assets:
$ npm run build-assetsCompile e-mails:
$ npm run build-emailsStart the development server:
$ python manage.py runserver