2
0
mirror of https://github.com/inventree/inventree-docs.git synced 2025-04-28 05:36:46 +00:00
This commit is contained in:
Oliver Walters 2021-04-11 13:49:45 +10:00
parent f1faafe334
commit ee1ae6dd51
10 changed files with 160 additions and 138 deletions

View File

@ -12,7 +12,7 @@ In the admin interface, select the "Errors" view:
{% include 'img.html' %}
{% endwith %}
!!! note "URL"
!!! info "URL"
Alternatively, navigate to the error list view at /admin/error_report/error/
A list of error logs is presented.
@ -21,7 +21,7 @@ A list of error logs is presented.
{% include 'img.html' %}
{% endwith %}
!!! note "Deleting Logs"
!!! info "Deleting Logs"
Error logs should be deleted periodically
## Reporting Errors

View File

@ -15,7 +15,7 @@ To access the manufacturer page, click on the "Buy" navigation tab and click on
Once the manufacturer page is loaded, click on the "<span class='fas fa-plus-circle'></span> New Manufacturer" button: the "Create new Manufacturer" form opens. Fill-in the manufacturer informations (`Company name` and `Company description` are required) then click on the "Submit" button.
!!! note "Manufacturer vs Supplier"
!!! info "Manufacturer vs Supplier"
In the case the manufacturer sells directly to customers, you may want to enable the checkbox `is supplier` before submitting the form (you can also enable it later on). Purchase orders rely exclusively on [supplier parts](../supplier#supplier-parts), therefore the manufacturer will need to be set as a supplier too.
### Edit Manufacturer

View File

@ -15,7 +15,7 @@ To access the supplier page, click on the "Buy" navigation tab and click on "Sup
Once the supplier page is loaded, click on the "<span class='fas fa-plus-circle'></span> New Supplier" button: the "Create new Supplier" form opens. Fill-in the supplier informations (`Company name` and `Company description` are required) then click on the "Submit" button.
!!! note "Supplier vs Manufacturer"
!!! info "Supplier vs Manufacturer"
In the case the supplier is a manufacturer who sells directly to customers, you may want to enable the checkbox `is manufacturer` before submitting the form (you can also enable it later on).
### Edit Supplier

View File

@ -42,5 +42,5 @@ Select the parameter `Template` you would like to use for this parameter, fill-o
### Parametric Tables
!!! note "Future Feature Proposal"
!!! info "Future Feature Proposal"
Allow parts to be filtered using parameters. Narrow down the list of parameters to the parts found in each category.

View File

@ -7,10 +7,10 @@ title: Development Server
!!! warning "Installation"
Before continuing, ensure that the [installation steps](../install) have been completed.
The following installation instructions can be used to launch a simple development server.
InvenTree includes a simple server application, suitable for use in a development environment.
!!! warning "Deployment"
Refer to the [deployment instructions](../deploy) to implement a much more robust server setup.
Refer to the [production server instructions](../production) to implement a much more robust server setup.
### Running on a Local Machine

View File

@ -4,13 +4,24 @@ title: Deploy InvenTree
## Initial Setup
Follow the instructions below to install the requried system packages, python modules, and InvenTree source code.
### Install System Packages
Install required system packages (as superuser).
Install required system packages (as superuser):
First, install required system packages as per the [OS requirements](../intro#os-requirements).
!!! warning "OS Specific Requirements"
The following packages are required on a debian system. A different distribution may require a slightly different set of packages
```
sudo apt-get update
sudo apt-get install python3 python3-dev
sudo apt-get install python3-pip python3-invoke python3-venv
```
!!! warning "Weasyprint"
On some systems, the dependencies for the `weasyprint` package might not be installed. Consider running through the [weasyprint installation steps](https://weasyprint.readthedocs.io/en/stable/install.html) before moving forward.
Next, install the system packages [required for your particular database](../intro#database-requirements).
### Create InvenTree User
@ -20,7 +31,7 @@ Next, install the system packages [required for your particular database](../int
Create a user account from which we will run the server:
```
sudo useradd --create-home inventree
sudo useradd -m -d /home/inventree -s /bin/bash inventree
```
InvenTree source code, log files, etc will be located under the `/home/inventree/` directory.
@ -35,22 +46,20 @@ sudo su inventree
```
cd /home/inventree
mkdir log static media backup
mkdir log static data
```
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
* `/home/inventree/log` - Store InvenTree log files
* `/home/inventree/static` - Location of static files for the web server
* `/home/inventre/data` - Location of stored media and backup files
### Download Source Code
Download InvenTree source code, into the `./src` directory:
```
cd /home/inventree
git clone https://github.com/inventree/inventree src
```
@ -63,22 +72,19 @@ python3 -m venv env
source ./env/bin/activate
```
The shell prompt should now display the `(env)` prefix.
!!! info "(env) prefix"
The shell prompt should now display the `(env)` prefix, showing that you are operating within the context of the python virtual environment
### 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):
```
(env) cd src
(env) invoke install
pip install -U -r src/requirements.txt
```
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).
## Create Database
As part of the initial setup, an empty database needs to be created. Follow the instructions below particular to your database engine of choice:
@ -89,6 +95,9 @@ SQLite uses a simple portable database file which is easy to use for debug and t
Install required packages as follows:
!!! info "Sudo Actions"
Perform sudo actions from a separate shell, as 'inventree' user does not have sudo access
```
sudo apt-get install sqlite3
```
@ -97,82 +106,72 @@ A `.sqlite3` database file will be automatically created, at the location specif
### PostgreSQL
#### Install PostgreSQL
Install required system packages:
!!! info "Sudo Actions"
Perform sudo actions from a separate shell, as 'inventree' user does not have sudo access
```
sudo apt-get install postgresql postgresql-contrib libpq-dev
```
And start the postgresql service:
```
sudo service postgresql start
```
#### Create Database and User
We need to create new database, and a postgres user to allow database access.
```
sudo -u postgres psql
```
You should now be in an interactive database shell:
```
create database inventree;
create user myuser with encrypted password 'mypass';
grant all privileges on database inventree to myuser;
```
!!! info "Username / Password"
You should change the username and password from the values specified above. This username and password will also be for the InvenTree database connection configuration.
#### Install Python Bindings
The PostgreSQL python binding must also be installed (into your virtual environment):
```
(env) pip3 install psycopg2 pgcli
```
Assuming the postgresql server is installed and running, switch to the `postgres` user and create a new database:
```
sudo su - postgres
```
You should now be in a shell session for the `postgres` user. Login to the database server as follows:
```
psql
```
Create a new database:
```
CREATE DATABASE inventree;
```
*Note: The name of the database will be required in the configuration section*
Create a user account associated with the new database.
```
CREATE USER inventreeuser WITH PASSWORD "password";
```
*Note: Choose different username and password values, and remember them for the configuration section*.
Set the following database configuration options:
```
ALTER ROLE inventreeuser SET client_encoding TO 'utf8';
ALTER ROLE inventreeuser SET default_transaction_isolation TO 'read committed';
ALTER ROLE inventreeuser SET timezone TO 'UTC';
GRANT ALL PRIVILEGES ON DATABASE inventree TO inventreeuser;
```
Exit the postgresql shell:
```
\q
```
Exit out of the `postgres` user's shell:
```
exit
pip3 install psycopg2 pgcli
```
### MySQL / MariaDB
#### Install Backend
To run InvenTree with the MySQL or MariaDB backends, a number of extra packages need to be installed:
!!! info "Sudo Actions"
Perform sudo actions from a separate shell, as 'inventree' user does not have sudo access
```
sudo apt-get install mysql-server libmysqlclient-dev
```
Install the python bindings for MySQL:
#### Install Python Bindings
Install the python bindings for MySQL (into the python virtual environment).
```
(env) pip3 install mysqlclient mariadb
pip3 install mysqlclient mariadb
```
#### Create Database
Assuming the MySQL server is installed and running, login to the MySQL server as follows:
@ -189,7 +188,7 @@ mysql> CREATE DATABASE inventree;
Create a new user with complete access to the database:
```
mysql> CREATE USER 'inventreeuser'@'%' IDENTIFIED WITH mysql_native_password BY 'inventree';
mysql> CREATE USER 'myuser'@'%' IDENTIFIED WITH mysql_native_password BY 'mypass';
mysql> GRANT ALL ON blog_data.* TO 'djangouser'@'%';
mysql> FLUSH PRIVILEGES;
```
@ -200,6 +199,9 @@ Exit the mysql shell:
mysql> EXIT;
```
!!! info "Username / Password"
You should change the username and password from the values specified above. This username and password will also be for the InvenTree database connection configuration.
## Configure InvenTree Options
Once the required software packages are installed and the database has been created, the InvenTree server options must be configured.
@ -212,7 +214,7 @@ Edit the configuration file at `/home/inventree/src/InvenTree/config.yaml`.
Refer to the [configuration guidelines](../config) for full details.
!!! warning "Configure Database"
Ensure database settings are correctly configured before proceeding to the next step!
Ensure database settings are correctly configured before proceeding to the next step! In particular, check that the database connection settings match the database you have created in the previous step.
## Initialize Database
@ -223,7 +225,8 @@ The database has been configured above, but is currently empty.
Run the following command to initialize the database with the required tables.
```
(env) invoke update
cd /home/inventree/src
invoke update
```
### Create Admin Account
@ -231,7 +234,7 @@ Run the following command to initialize the database with the required tables.
Create a superuser (admin) account for the InvenTree installation:
```
(env) invoke superuser
invoke superuser
```
!!! success "Ready to Serve"
@ -252,32 +255,3 @@ Refer to the [development server instructions](../development) for further infor
In a production environment, a more robust server setup is required.
Refer to the [production server instructions](../production) for further information.
## Install Gunicorn
Gunicorn can be installed using PIP:
```
pip3 install gunicorn
```
!!! warning "Python Environment"
Ensure that gunicorn is installed within the same python environment context as the InvenTree install - otherwise gunicorn will not be able to import the correct python modules.
### Configure Gunicorn
The Gunicorn server can be configured with a simple configuration file (e.g. python script). An example configuration file is provided in ``InvenTree/gunicorn.conf.py``
``` python
{% include 'gunicorn.conf.py' %}
```
This file can be used to configure the Gunicorn server to match particular requirements.
### Run Gunicorn
```
cd InvenTree
gunicorn -c gunicorn.conf.py InvenTree.wsgi
```

View File

@ -44,28 +44,6 @@ The InvenTree documentation assumes that the operating system is a debian based
!!! warning "Installing on Windows"
Installation on Windows is *not guaranteed* to work (at all). To install on a Windows system, it is highly recommended that you [install WSL](https://docs.microsoft.com/en-us/windows/wsl/install-win10#manual-installation-steps), and then follow installation procedure from within the WSL environment.
!!! warning "Weasyprint"
On some systems, the dependencies for the `weasyprint` package might not be installed. Consider running through the [weasyprint installation steps](https://weasyprint.readthedocs.io/en/stable/install.html) before moving forward.
The following minimum packages are required to be installed on a system level:
### Debian
```
sudo apt-get update
sudo apt-get install python3 python3-dev
sudo apt-get install python3-pip python3-invoke python3-venv
```
### FreeBSD
```
pkg install python
pkg install py37-pip
pkg install py37-wheel
pkg install py37-invoke
```
## Python Requirements
InvenTree runs on [Python](https://python.org).
@ -92,7 +70,7 @@ Installing the required Python packages inside a virtual environment allows a lo
You can read more about Python virtual environments [here](https://docs.python.org/3/tutorial/venv.html).
!!! note "Virtual Environment"
!!! info "Virtual Environment"
The installation intstruction assume that a virtual environment is configured
`cd` into the InvenTree directory, and create a virtual environment with the following command:
@ -111,7 +89,7 @@ To configure Inventree inside a virtual environment, ``cd`` into the inventree b
source env/bin/activate
```
!!! note "Activate Virtual Environment"
!!! info "Activate Virtual Environment"
if
```
source env/bin/activate
@ -134,7 +112,7 @@ git clone https://github.com/inventree/inventree/
Alternatively, the source can be downloaded as a [.zip archive](https://github.com/inventree/InvenTree/archive/master.zip).
!!! note "Updating via Git"
!!! info "Updating via Git"
Downloading the source code using Git is recommended, as it allows for simple updates when a new version of InvenTree is released.
## Installation Guides

View File

@ -21,6 +21,74 @@ The InvenTree web server is hosted using [Gunicorn](https://gunicorn.org/). Guni
[Supervisor](http://supervisord.org/) is a process control system which monitors and controls multiple background processes. It is used in the InvenTree production setup to ensure that the server and background worker processes are always running.
## Setup
## Gunicorn
## Start Supervisor
Gunicorn should have already been installed (within the python virtual environment) as part of the installation procedure.
A simple gunicorn configuration file is also provided. This configuration file can be edited if different server settings are required
### Test Gunicorn Server
First, let's confirm that the gunicorn server is operational.
!!! info "Virtual Environment"
Don't forget to activate the python virtual environment
```
cd /home/InvenTree
source ./env/bin/activate
cd src/InvenTree
/home/inventree/env/bin/gunicorn -c gunicorn.conf.py InvenTree.wsgi -b 127.0.0.1:8000
```
This should start the gunicorn server as a foreground process.
Check that you can access the InvenTree web server [in your browser](http://127.0.0.1:8000):
### Stop Gunicorn Server
Once the gunicorn server is operational, kill the server with <kbd>Ctrl</kbd>+<kbd>c</kbd>
## Supervisor
We will use [supervisor](http://supervisord.org/) as a process monitor, to ensure the web server and background worker processes are automatically started, and restarted if something goes wrong.
### Install Supervisor
!!! info "Sudo Actions"
Perform sudo actions from a separate shell, as 'inventree' user does not have sudo access
```
sudo apt-get install supervisor
```
### Configure Supervisor
!!! warning "Configuration Override"
If you already have supervisor installed on your system, you will not want to override your existing configuration file.
In this case, edit the existing configuration file at `/etc/supervisord.conf` to integrate the InvenTree processes
Copy the supervisor configuration file:
```
sudo cp /home/inventree/src/deploy/supervisord.conf /etc/supervisord.conf
```
### Start Supervisor Daemon
```
sudo supervisord
```
### Check Server
Check that the InvenTree [web server is running](http://localhost:8000).
### View Process Status
The process status can be viewed [in your web browser](http://localhost:9001).
## Production Ready
The InvenTree server (and background task manager) should now be running!

View File

@ -46,7 +46,7 @@ Setting the owner of stock location will automatically:
* Set the owner of all children locations to the same owner.
* Set the owner of all stock items at this location to the same owner.
!!! note
!!! info
If the owner of a children location or a stock item is a subset of the specified owner (eg. a user linked to the specified group), the owner won't be updated.
### Set Stock Item Owner

View File

@ -44,9 +44,11 @@ nav:
- Contribute: contribute.md
- Installation:
- Introduction: start/intro.md
- Configuration: start/config.md
- Docker Installation: start/docker.md
- Manual Installation: start/install.md
- Configuration: start/config.md
- Development Server: start/development.md
- Production Server: start/production.md
- Updating: start/update.md
- Migrating: start/migrate.md
- Parts: