Installation for macOS

Prerequisites

Before you are ready to run Saleor you will need additional software installed on your computer.

Node.js

Version 8 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.

Make sure you keep track of the password you set for the administration account during installation.

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)"

Python 3

Use Homebrew to install the latest version of Python 3:

$ brew install python3

Git

Use Homebrew to install Git:

$ brew install git

Gtk+

Use Homebrew to install the graphical libraries necessary for PDF creation:

$ brew install cairo pango gdk-pixbuf libffi

Installation

  1. Clone the repository (or use your own fork):

    $ git clone https://github.com/mirumee/saleor.git
    
  2. Enter the directory:

    $ cd saleor/
    
  3. Install all dependencies:

    We strongly recommend creating a virtual environment before installing any Python packages.

    $ pip install -r requirements.txt
    
  4. Set SECRET_KEY environment variable.

    We try to provide usable default values for all of the settings. We’ve decided not to provide a default for SECRET_KEY as 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_KEY defeats many of Django’s security protections, and can lead to privilege escalation and remote code execution vulnerabilities. Consult Django’s documentation for details.

  5. Create a PostgreSQL user:

    Unless configured otherwise the store will use saleor as both username and password. Remeber to give your user the SUPERUSER privilege so it can create databases and database extensions.

    ..code-block:: console

    $ createuser –superuser –pwprompt saleor

    Enter saleor when prompted for password.

  6. Prepare the database:

    $ python manage.py migrate
    

    Warning

    This command will need to be able to create database extensions. If you get an error related to the CREATE EXTENSION command please review the notes from the user creation step.

  7. Install front-end dependencies:

    $ npm install
    

    Note

    If this step fails go back and make sure you’re using new enough version of Node.js.

  8. Prepare front-end assets:

    $ npm run build-assets
    
  9. Compile e-mails:

    $ npm run build-emails
    
  10. Start the development server:

    $ python manage.py runserver