2
0
mirror of https://github.com/inventree/inventree-docs.git synced 2025-04-28 05:36:46 +00:00

More docs

(cherry picked from commit 6386f6921377448a1472145a55f6cd386959b298)
This commit is contained in:
Oliver Walters 2021-03-24 22:23:59 +11:00
parent bb99884d68
commit 3fddd8d2da
3 changed files with 68 additions and 30 deletions

View File

@ -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. 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). Install required system packages (as superuser).
@ -26,6 +25,22 @@ Then, install the supervisor process manager:
sudo apt-get install supervisor 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 ### 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: 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. 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 ### Create Required Directories
``` ```
mkdir log static media mkdir log static media backup
``` ```
This step creates directories required by InvenTree: This step creates directories required by InvenTree:
@ -81,8 +88,53 @@ This step creates directories required by InvenTree:
* **log** - Store InvenTree log files * **log** - Store InvenTree log files
* **static** - Location of static files for the web server * **static** - Location of static files for the web server
* **media** - Location of uploaded media files * **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. The InvenTree development server is useful for testing and configuration - and it may be wholly sufficient for a small-scale installation.

View File

@ -30,24 +30,6 @@ To display a list of the available configuration scripts, run the following comm
inv --list 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 ### 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. 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.

View File

@ -74,6 +74,10 @@ InvenTree runs on [Python](https://python.org).
!!! warning "Python Version" !!! 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. 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 ### 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. 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.