diff --git a/docs/start/deploy.md b/docs/start/deploy.md index 6f0292f..360bc21 100644 --- a/docs/start/deploy.md +++ b/docs/start/deploy.md @@ -12,9 +12,8 @@ There are also numerous online tutorials describing how to deploy a Django appli The following instructions provide a reasonably performant server, using [gunicorn](https://gunicorn.org/) as a webserver, and [supervisor](http://supervisord.org/) as a process manager. -## Initial Setup -### Install System Packages +## Install System Packages Install required system packages (as superuser). @@ -26,6 +25,22 @@ Then, install the supervisor process manager: sudo apt-get install supervisor ``` +Next, install the system packages required for your particular database: + +### MySQL + +``` +sudo apt-get install mysql-server libmysqlclient-dev +``` + +### Postgresql + +``` +sudo apt-get install postgresql postgresql-contrib libpq-dev +``` + +### Initial Setup + ### Create InvenTree User It is highly recommended that the InvenTree server is not run under root. Create a user account from which we will run the server: @@ -62,18 +77,10 @@ source ./env/bin/activate The shell prompt should now display the `(env)` prefix. -### Install Python Packages - -``` -pip3 install -U -r src/requirements.txt -``` - -This command will install all of the python binaries and library files required for the InvenTree installation. - ### Create Required Directories ``` -mkdir log static media +mkdir log static media backup ``` This step creates directories required by InvenTree: @@ -81,8 +88,53 @@ This step creates directories required by InvenTree: * **log** - Store InvenTree log files * **static** - Location of static files for the web server * **media** - Location of uploaded media files +* **backup** - Location of database backup files -### Development Server +## Install InvenTree Packages + +The Python packages required by the InvenTree server must be installed into the virtual environment. + +Run the `invoke install` command (from within the src directory): + +``` +cd src +invoke install +``` + +This installs all required Python packages using pip package manager. It also creates a (default) database configuration file which needs to be edited to meet user needs before proceeding (see next step below). + +Additionally, this step creates a *SECRET_KEY* file which is used for the django authentication framework. + +!!! warning "Keep it secret, keep it safe" + The SECRET_KEY file should never be shared or made public. + +You will also need to install the python packages required for your particular database backend: + +### MySQL + +``` +pip3 install mysqlclient +``` + +### Postgresql + +``` +pip3 install psycopg2 +``` + +## Configure InvenTree Options + +Once the required software packages are installed, the database and server options must be configured. + +Edit the configuration file at `/home/inventree/src/InvenTree/config.yaml`. + +!!! info "Config Guidelines" + Refer to the [configuration guidelines](../config) for full details. + +!!! warning "Configure Database" + Ensure database settings are correctly configured in `config.yaml` before proceeding to the next step! + +# Development Server The InvenTree development server is useful for testing and configuration - and it may be wholly sufficient for a small-scale installation. diff --git a/docs/start/install.md b/docs/start/install.md index d1a14b6..2e87ea1 100644 --- a/docs/start/install.md +++ b/docs/start/install.md @@ -30,24 +30,6 @@ To display a list of the available configuration scripts, run the following comm inv --list ``` -## Installation - -Now that the source code is downloaded (and optionally you have configured a Python virtual environment), the Python packages required to run InvenTree can be installed. InvenTree is a Python/Django application and relies on the pip package manager. All packages required to develop and test InvenTree are installed via pip. Package requirements can be found in ``requirements.txt``. - - -To setup the InvenTree environment, run the following commands (from the InvenTree source directory): - -``` -inv install -``` - -This installs all required Python packages using pip package manager. It also creates a (default) database configuration file which needs to be edited to meet user needs before proceeding (see next step below). - -Additionally, this step creates a *SECRET_KEY* file which is used for the django authentication framework. - -!!! warning "Keep it secret, keep it safe" - The SECRET_KEY file should never be shared or made public. - ### Database Configuration Once the required packages are installed, the database configuration must be adjusted to suit your particular needs. InvenTree provides a simple default setup which should work *out of the box* for testing and debug purposes. diff --git a/docs/start/intro.md b/docs/start/intro.md index 6b48b35..cf76da2 100644 --- a/docs/start/intro.md +++ b/docs/start/intro.md @@ -74,6 +74,10 @@ InvenTree runs on [Python](https://python.org). !!! warning "Python Version" InvenTree requrires Python 3.6 (or newer). If your system has an older version of Python installed, you will need to follow the update instructions for your OS. +### Invoke + +InvenTree makes use of the [invoke](https://www.pyinvoke.org/) python toolkit for performing various administrative actions + ### Virtual Environment Installing the required Python packages inside a virtual environment allows a local install separate to the system-wide Python installation. While not strictly necessary, using a virtual environment is **highly recommended** as it prevents conflicts between the different Python installations.