Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Split installation docs
Patryk Zawadzkiccd2c6b701b9
diff --git a/docs/customization.rst b/docs/customization.rstindex ca26d32158..6ab98bd042 100644--- a/docs/customization.rst+++ b/docs/customization.rst@@ -10,3 +10,4 @@ Customizing Saleorcustomization/backendcustomization/testscustomization/ci+ customization/pypydiff --git a/docs/customization/backend.rst b/docs/customization/backend.rstindex b71532da35..f106b34e91 100644--- a/docs/customization/backend.rst+++ b/docs/customization/backend.rst@@ -1,8 +1,8 @@Working with Python Code========================-Python dependencies-~~~~~~~~~~~~~~~~~~~+Managing Dependencies+---------------------To guarantee repeatable installations all project dependencies are managed using `pip-tools <https://github.com/nvie/pip-tools>`_.Project's direct dependencies are listed in ``requirements.in`` and running :code:`pip-compile` generates ``requirements.txt`` that has all versions pinned.diff --git a/docs/customization/docker.rst b/docs/customization/docker.rstindex a26023529d..912610ec4f 100644--- a/docs/customization/docker.rst+++ b/docs/customization/docker.rst@@ -1,4 +1,4 @@-.. _docker_dev:+.. _docker-dev:Using Docker for Development============================@@ -8,7 +8,7 @@ Using Docker to build software allows you to run and test code without having to.. warning::The following setup is only meant for local development.- See :ref:`docker_deployment` for production use of Docker.+ See :ref:`docker-deployment` for production use of Docker.Local Prerequisitesdiff --git a/docs/customization/pypy.rst b/docs/customization/pypy.rstnew file mode 100644index 0000000000..df7cb60a39--- /dev/null+++ b/docs/customization/pypy.rst@@ -0,0 +1,8 @@+Running with PyPy 3.5+=====================++Saleor works well with PyPy 3.5 and using it is an option when additional performance is required.++The default PostgreSQL driver is not compatible with PyPy so you will need to replace it with a ``cffi``-based one.++Please consult the installation instructions provided by `psycopg2cffi <https://github.com/chtd/psycopg2cffi#installation>`_.diff --git a/docs/deployment/docker.rst b/docs/deployment/docker.rstindex d0ee3f9bcd..cdea2d0b6d 100644--- a/docs/deployment/docker.rst+++ b/docs/deployment/docker.rst@@ -1,4 +1,4 @@-.. _docker_deployment:+.. _docker-deployment:Docker======diff --git a/docs/deployment/heroku.rst b/docs/deployment/heroku.rstindex 3c3a29c6e5..971554609e 100644--- a/docs/deployment/heroku.rst+++ b/docs/deployment/heroku.rst@@ -19,7 +19,7 @@ Configuration.. note::- Heroku's storage is volatile. This means that all instances of your application will have separate disks and will lose all changes made to the local disk each time the application is restarted. The best approach is to use cloud storage such as Amazon S3. See :ref:`amazon_s3` for configuration details.+ Heroku's storage is volatile. This means that all instances of your application will have separate disks and will lose all changes made to the local disk each time the application is restarted. The best approach is to use cloud storage such as Amazon S3. See :ref:`amazon-s3` for configuration details.Deploymentdiff --git a/docs/deployment/s3.rst b/docs/deployment/s3.rstindex 6c7e48ec10..34a05c3f27 100644--- a/docs/deployment/s3.rst+++ b/docs/deployment/s3.rst@@ -1,4 +1,4 @@-.. _amazon_s3:+.. _amazon-s3:Storing Files on Amazon S3==========================diff --git a/docs/gettingstarted.rst b/docs/gettingstarted.rstindex bf55aace0b..3718995ba0 100644--- a/docs/gettingstarted.rst+++ b/docs/gettingstarted.rst@@ -4,5 +4,8 @@ Getting Started.. toctree:::maxdepth: 1- gettingstarted/installation+ gettingstarted/installation-macos+ gettingstarted/installation-windows+ gettingstarted/installation-linuxgettingstarted/configuration+ gettingstarted/example-datadiff --git a/docs/gettingstarted/configuration.rst b/docs/gettingstarted/configuration.rstindex dd32b84386..150adc1795 100644--- a/docs/gettingstarted/configuration.rst+++ b/docs/gettingstarted/configuration.rst@@ -26,7 +26,7 @@ Environment variables``DATABASE_URL``- Defaults to a local PostgreSQL instance. See :ref:`docker-compose` for how to get a local database running inside a Docker container.+ Defaults to a local PostgreSQL instance. See :ref:`docker-dev` for how to get a local database running inside a Docker container.Most Heroku databases will export this setting automatically.diff --git a/docs/gettingstarted/example-data.rst b/docs/gettingstarted/example-data.rstnew file mode 100644index 0000000000..527bf11a62--- /dev/null+++ b/docs/gettingstarted/example-data.rst@@ -0,0 +1,8 @@+Example Data+============++If you'd like some data to test your new storefront you can populate the database with example products and orders:++.. code-block:: console++ $ python manage.py populatedbdiff --git a/docs/gettingstarted/installation.rst b/docs/gettingstarted/installation-linux.rstsimilarity index 56%rename from docs/gettingstarted/installation.rstrename to docs/gettingstarted/installation-linux.rstindex c51eb40ebe..eba05d273b 100644--- a/docs/gettingstarted/installation.rst+++ b/docs/gettingstarted/installation-linux.rst@@ -1,57 +1,73 @@-Installation-============+Installation for Linux+======================.. note::- If you prefer using containers or have problems with configuring PostgreSQL, Redis and Elasticsearch, try :ref:`docker_dev` instructions.+ If you prefer using containers or have problems with configuring PostgreSQL, Redis and Elasticsearch, try :ref:`docker-dev` instructions.Prerequisites--------------Before you are ready to run Saleor you will need certain software installed on your computer.+Before you are ready to run Saleor you will need additional software installed on your computer.Python 3~~~~~~~~-Saleor requires Python 3.4 or later. To install the latest version visit the `Python download page <https://www.python.org/downloads/>`_ and follow the instructions.-- .. note::-- Saleor does work with PyPy 3.5 but you'll need to replace the default PostgreSQL driver with a ``cffi``-based one.+Saleor requires Python 3.4 or later. A compatible version comes preinstalled with most current Linux systems. If that is not the case consult your distribution for instructions on how to install Python 3.6.Node.js~~~~~~~-Version 8 or later is required.--**Windows** users can `download an official Node.js installer <https://nodejs.org/en/download/>`_.+Version 8 or later is required. See the `installation instructions <https://nodejs.org/en/download/package-manager/>`_.-**macOS** and **Linux** users can `install Node.js using a package manager <https://nodejs.org/en/download/package-manager/>`_.-- .. note::+.. note::- Debian and Ubuntu users who install Node.js using system packages will also need to install the ``nodejs-legacy`` package.+ Debian and Ubuntu users who install Node.js using system packages will also need to install the ``nodejs-legacy`` package.PostgreSQL~~~~~~~~~~-Saleor needs PostgreSQL version 9.4 or above to work. Please visit `the project's download page <https://www.postgresql.org/download/>`_ for details.+Saleor needs PostgreSQL version 9.4 or above to work. Use the `PostgreSQL download page <https://www.postgresql.org/download/>`_ to get instructions for your distribution.-System dependencies-~~~~~~~~~~~~~~~~~~~+Gtk++~~~~Some features like PDF creation require that additional system libraries are present.-**Windows** users should follow the `WeasyPrint instructions for Windows <http://weasyprint.readthedocs.io/en/latest/install.html#windows>`_.+Debian / Ubuntu+_______________++Debian 9.0 Stretch or newer, Ubuntu 16.04 Xenial or newer:++.. code-block:: console++ $ sudo apt-get install build-essential python3-dev python3-pip python3-cffi libcairo2 libpango-1.0-0 libpangocairo-1.0-0 libgdk-pixbuf2.0-0 libffi-dev shared-mime-info++Fedora+______++.. code-block:: console++ $ sudo yum install redhat-rpm-config python-devel python-pip python-cffi libffi-devel cairo pango gdk-pixbuf2++Archlinux+_________++.. code-block:: console++ $ sudo pacman -S python-pip cairo pango gdk-pixbuf2 libffi pkg-config-**macOS** users should follow the `WeasyPrint instructions for OS X <http://weasyprint.readthedocs.io/en/latest/install.html#os-x>`_.+Gentoo+______-**Linux** users should follow the `WeasyPrint instructions for Linux <http://weasyprint.readthedocs.io/en/latest/install.html#linux>`_.+.. code-block:: console++ $ emerge pip cairo pango gdk-pixbuf cffiInstallation@@ -59,14 +75,14 @@ Installation#. Clone the repository (or use your own fork):- .. code-block:: bash+ .. code-block:: console$ git clone https://github.com/mirumee/saleor.git#. Enter the directory:- .. code-block:: bash+ .. code-block:: console$ cd saleor/@@ -75,25 +91,25 @@ InstallationWe strongly recommend `creating a virtual environment <https://docs.python.org/3/tutorial/venv.html>`_ before installing any Python packages.- .. code-block:: bash+ .. code-block:: console$ pip install -r requirements.txt#. Set ``SECRET_KEY`` environment variable.- .. note::+ 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.- 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 <https://docs.djangoproject.com/en/1.11/ref/settings/#secret-key>`_ for details.+ .. code-block:: console- 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>'- .. code-block:: bash+ .. warning::- $ export SECRET_KEY='<mysecretkey>'+ 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 <https://docs.djangoproject.com/en/1.11/ref/settings/#secret-key>`_ for details.#. Create a PostgreSQL user:@@ -123,7 +139,7 @@ Installation#. Prepare the database:- .. code-block:: bash+ .. code-block:: console$ python manage.py migrate@@ -133,7 +149,7 @@ Installation#. Install front-end dependencies:- .. code-block:: bash+ .. code-block:: console$ npm install@@ -143,23 +159,13 @@ Installation#. Prepare front-end assets:- .. code-block:: bash+ .. code-block:: console$ npm run build-assets#. Start the development server:- .. code-block:: bash+ .. code-block:: console$ python manage.py runserver---Example data---------------If you'd like some data to test your new storefront you can populate the database with example products and orders:--.. code-block:: bash-- $ python manage.py populatedbdiff --git a/docs/gettingstarted/installation-macos.rst b/docs/gettingstarted/installation-macos.rstnew file mode 100644index 0000000000..b7f91ca52d--- /dev/null+++ b/docs/gettingstarted/installation-macos.rst@@ -0,0 +1,154 @@+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 <https://nodejs.org/en/download/>`_.+++PostgreSQL+~~~~~~~~~~++Saleor needs PostgreSQL version 9.4 or above to work. Get the macOS installer from the `PostgreSQL download page <https://www.postgresql.org/download/macosx/>`_.++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 <https://developer.apple.com/download/more/>`_.+++Homebrew+~~~~~~~~++Run the following command:++.. code-block:: console++ $ /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:++.. code-block:: console++ $ brew install python3+++Git+~~~++Use Homebrew to install Git:++.. code-block:: console++ $ brew install git+++Gtk++~~~~++Use Homebrew to install the graphical libraries necessary for PDF creation:++.. code-block:: console++ $ brew install cairo pango gdk-pixbuf libffi+++Installation+------------++#. Clone the repository (or use your own fork):++ .. code-block:: console++ $ git clone https://github.com/mirumee/saleor.git+++#. Enter the directory:++ .. code-block:: console++ $ cd saleor/+++#. Install all dependencies:++ We strongly recommend `creating a virtual environment <https://docs.python.org/3/tutorial/venv.html>`_ before installing any Python packages.++ .. code-block:: console++ $ pip install -r requirements.txt+++#. 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.++ .. code-block:: console++ $ 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 <https://docs.djangoproject.com/en/1.11/ref/settings/#secret-key>`_ for details.+++#. 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.+++#. Prepare the database:++ .. code-block:: console++ $ 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.++#. Install front-end dependencies:++ .. code-block:: console++ $ npm install++ .. note::++ If this step fails go back and make sure you're using new enough version of Node.js.++#. Prepare front-end assets:++ .. code-block:: console++ $ npm run build-assets+++#. Start the development server:++ .. code-block:: console++ $ python manage.py runserverdiff --git a/docs/gettingstarted/installation-windows.rst b/docs/gettingstarted/installation-windows.rstnew file mode 100644index 0000000000..4576cb29d5--- /dev/null+++ b/docs/gettingstarted/installation-windows.rst@@ -0,0 +1,132 @@+Installation for Windows+========================++This guide assumes a 64-bit installation of Windows.+++Prerequisites+-------------++Before you are ready to run Saleor you will need additional software installed on your computer.+++Python+~~~~~~++Download the latest 3.6 Windows installer from the `Python download page <https://www.python.org/downloads/>`_ and follow the instructions.++Make sure that "**Add Python 3.6 to PATH**" is checked.+++Node.js+~~~~~~~++Version 8 or later is required. Download the Windows installer from the `Node.js downloads page <https://nodejs.org/en/download/>`_.++Make sure that "**Add to PATH**" is selected.+++PostgreSQL+~~~~~~~~~~++Saleor needs PostgreSQL version 9.4 or above to work. Get the Windows installer from the `project's download page <https://www.postgresql.org/download/windows/>`_.++Make sure you keep track of the password you set for the administration account during installation.+++GTK++~~~~++Download the `64-bit Windows installer <https://github.com/tschoonj/GTK-for-Windows-Runtime-Environment-Installer>`_.++Make sure that "**Set up PATH environment variable to include GTK+**" is selected.+++Compilers+~~~~~~~~~++Please download and install the latest version of `Visual C++ build tools <https://landinghub.visualstudio.com/visual-cpp-build-tools>`_.+++Installation+------------++All commands need to be performed in either PowerShell or a Command Shell.++#. Clone the repository (replace the URL with your own fork where needed):++ .. code-block:: powershell++ git clone https://github.com/mirumee/saleor.git+++#. Enter the directory:++ .. code-block:: powershell++ cd saleor/+++#. Install all dependencies:++ We strongly recommend `creating a virtual environment <https://docs.python.org/3/tutorial/venv.html>`_ before installing any Python packages.++ .. code-block:: powershell++ python -m pip install -r requirements.txt+++#. 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.++ .. code-block:: powershell++ $env: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 <https://docs.djangoproject.com/en/1.11/ref/settings/#secret-key>`_ for details.+++#. Create a PostgreSQL user:++ Use the **pgAdmin** tool that came with your PostgreSQL installation to create a database user for your store.++ 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.++#. Prepare the database:++ .. code-block:: powershell++ python manage.py migrate++ .. warning::++ This command will need to be able to create a database and some database extensions. If you get an error related to these make sure you've properly assigned your user ``SUPERUSER`` privileges.++#. Install front-end dependencies:++ .. code-block:: powershell++ npm install++ .. note::++ If this step fails go back and make sure you're using new enough version of Node.js.++#. Prepare front-end assets:++ .. code-block:: powershell++ npm run build-assets+++#. Start the development server:++ .. code-block:: powershell++ python manage.py runserver