From b941a4115ffa3920d6a0b06f247a4b957bff6e0b Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Wed, 10 Jul 2019 23:11:41 +1000 Subject: [PATCH] Documentation for settings file --- docs/config.rst | 35 +++++++++++++++++++++++++++++++++++ docs/index.rst | 1 + docs/start.rst | 15 ++++++++++++--- 3 files changed, 48 insertions(+), 3 deletions(-) create mode 100644 docs/config.rst diff --git a/docs/config.rst b/docs/config.rst new file mode 100644 index 0000000000..68f45d4402 --- /dev/null +++ b/docs/config.rst @@ -0,0 +1,35 @@ +InvenTree Configuration +======================= + +.. toctree:: + :titlesonly: + :maxdepth: 2 + :caption: Configuration + :hidden: + +Admin users will need to adjust the InvenTree installation to meet the particular needs of their setup. For example, pointing to the correct database backend, or specifying a list of allowed hosts. + +The Django configuration parameters are found in the normal place (``settings.py``). However the settings presented in this file should not be adjusted as they will alter the core behaviour of the InvenTree application. + +To support install specific settings, a simple configuration file ``config.yaml`` is provided. This configuration file is loaded by ``settings.py`` at runtime. Settings specific to a given install should be adjusted in ``config.yaml``. + +The default configuration file launches a *DEBUG* configuration with a simple SQLITE database backend. This default configuration file is shown below: + +.. literalinclude :: ../InvenTree/config.yaml + :language: yaml + :linenos: + +Database Options +---------------- + +InvenTree provides support for multiple database backends - any backend supported natively by Django can be used. + +Database options are specified under the *database* heading in the configuration file. Any option available in the Django documentation can be used here - it is passed through transparently to the management scripts. + +**SQLITE:** +By default, InvenTree uses an sqlite database file : ``inventree_db.sqlite3``. This provides a simple, portable database file that is easy to use for debug and testing purposes. + + +**MYSQL:** MySQL database backend is supported with the native Django implemetation. + +**POSTGRESQL:** PostgreSQL database backend is supported with the native Django implementation. Note that to use this backend, the ``psycopg2`` Python library must first be installed. \ No newline at end of file diff --git a/docs/index.rst b/docs/index.rst index 34ebc992b0..e7a4f52bad 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -8,6 +8,7 @@ InvenTree Source Documentation :hidden: Getting Started + Configuration Modal Forms Tables REST API diff --git a/docs/start.rst b/docs/start.rst index eab27e407f..829d051736 100644 --- a/docs/start.rst +++ b/docs/start.rst @@ -7,16 +7,16 @@ Getting Started Guide :caption: Getting Started :hidden: -To install a complete development environment for InvenTree, follow the steps presented below. +To install a complete *development* environment for InvenTree, follow the steps presented below. A production environment will require further work as per the particular application requirements. A makefile in the root directory provides shortcuts for the installation process, and can also be very useful during development. Installation ------------ -All packages required to develop and test InvenTree can be installed via pip package manager. Package requirements can be found in ``requirements.txt``. +InvenTree is a Python/Django application and relies on the pip package manager. All packages required to develop and test InvenTree can be installed via pip. Package requirements can be found in ``requirements.txt``. -To setup the InvenTree environment, run the command +To setup the InvenTree environment, run the command: ``make install`` @@ -25,6 +25,15 @@ which performs the following actions: * Installs all required Python packages using pip package manager * Generates a SECREY_KEY file required for the django authentication framework +Install Configuration +--------------------- + +InvenTree provides a simple default setup which should work *out of the box* for testing and debug purposes. For installation in production environments, further configuration options are available in the ``config.yaml`` configuration file. + +The configuration file provides administrators control over various setup options without digging into the Django ``settings.py`` script. The default setup uses a sqlite database with *DEBUG* mode enabled. + +For further information on installation configuration, refer to the `Configuration `_ section. + Superuser Account -----------------