From 4de12033bb0b3ff0a31af28d6cd76d647776ef39 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Mon, 2 Sep 2019 15:51:58 +1000 Subject: [PATCH 1/9] Change pip3 to python3-pip --- docs/start.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/start.rst b/docs/start.rst index 5e08bf8634..f5e770796a 100644 --- a/docs/start.rst +++ b/docs/start.rst @@ -17,7 +17,7 @@ Requirements To install InvenTree you will need the following: * python3 -* pip3 +* python3-pip * make Installation From 31f3ead5dc75c75a39a0ac8080c7c03881e1b2e4 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Mon, 2 Sep 2019 15:52:19 +1000 Subject: [PATCH 2/9] Andrew's eagle eyes --- docs/start.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/start.rst b/docs/start.rst index f5e770796a..75a13159cc 100644 --- a/docs/start.rst +++ b/docs/start.rst @@ -35,10 +35,10 @@ To setup the InvenTree environment, *cd into the inventree directory* and run th which 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 *SECREY_KEY* file which is used for the django authentication framework. +Additionally, this step creates a *SECRET_KEY* file which is used for the django authentication framework. .. important:: - The *SECREY_KEY* file should never be shared or made public. + The *SECRET_KEY* file should never be shared or made public. Database Configuration ----------------------- From d30cad2341bba6f1da032a82bb008f5cbb5d3d73 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Mon, 2 Sep 2019 16:05:19 +1000 Subject: [PATCH 3/9] Emphasis on config.yaml --- docs/start.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/start.rst b/docs/start.rst index 75a13159cc..fcce9a9131 100644 --- a/docs/start.rst +++ b/docs/start.rst @@ -14,7 +14,7 @@ A makefile in the root directory provides shortcuts for the installation process Requirements ------------ -To install InvenTree you will need the following: +To install InvenTree you will need the following system components installed: * python3 * python3-pip @@ -45,7 +45,7 @@ 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. -As part of the previous *install* step, a configuration file (*config.yaml*) is created. The configuration file provides administrators control over various setup options without digging into the Django ``settings.py`` script. The default setup uses a local sqlite database with *DEBUG* mode enabled. +As part of the previous *install* step, a configuration file (``config.yaml``) is created. The configuration file provides administrators control over various setup options without digging into the Django *settings.py* script. The default setup uses a local sqlite database with *DEBUG* mode enabled. For further information on installation configuration, refer to the `Configuration `_ section. From 92940f133399659cfe214652190debb8afc702f9 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Mon, 2 Sep 2019 16:05:26 +1000 Subject: [PATCH 4/9] Update makefile docs --- docs/start.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/start.rst b/docs/start.rst index fcce9a9131..4abf01436c 100644 --- a/docs/start.rst +++ b/docs/start.rst @@ -82,9 +82,10 @@ Development and Testing Other shorthand functions are provided for the development and testing process: -* ``make requirements`` - Install all required underlying packages using PIP -* ``make setup`` - Perform one-time setup functions +* ``make install`` - Install all required underlying packages using PIP * ``make superuser`` - Create a superuser account +* ``make migrate`` - Perform database migrations +* ``make mysql`` - Install packages required for MySQL database backend * ``make backup`` - Backup database tables and media files * ``make test`` - Run all unit tests * ``make coverage`` - Run all unit tests and generate code coverage report From b0c420858b57d79c819a48426a18791232a3bf52 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Mon, 2 Sep 2019 16:44:01 +1000 Subject: [PATCH 5/9] Comments for settings.py --- InvenTree/InvenTree/settings.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/InvenTree/InvenTree/settings.py b/InvenTree/InvenTree/settings.py index d89a57cb78..1e993e5068 100644 --- a/InvenTree/InvenTree/settings.py +++ b/InvenTree/InvenTree/settings.py @@ -231,16 +231,20 @@ USE_TZ = True # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/1.10/howto/static-files/ +# Web URL endpoint for served static files STATIC_URL = '/static/' +# The filesystem location for served static files STATIC_ROOT = CONFIG.get('static_root', os.path.join(BASE_DIR, 'static')) STATICFILES_DIRS = [ os.path.join(BASE_DIR, 'InvenTree', 'static'), ] +# Web URL endpoint for served media files MEDIA_URL = '/media/' +# The filesystem location for served static files MEDIA_ROOT = CONFIG.get('media_root', os.path.join(BASE_DIR, 'media')) # crispy forms use the bootstrap templates From 47e9c44c437614ded6a27fa04e1cac64779dc7db Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Mon, 2 Sep 2019 17:04:44 +1000 Subject: [PATCH 6/9] Prefix correct directory in docs --- docs/deploy.rst | 4 +++- docs/migrate.rst | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/deploy.rst b/docs/deploy.rst index 2ce5e7b255..8708243dc6 100644 --- a/docs/deploy.rst +++ b/docs/deploy.rst @@ -31,7 +31,9 @@ Directories for storing *media* files and *static* files should be specified in Collect Static Files -------------------- -The required static files must be collected into the specified ``STATIC_ROOT`` directory. Run ``python3 manage.py collectstatic`` +The required static files must be collected into the specified ``STATIC_ROOT`` directory: + +``python3 InvenTree/manage.py collectstatic`` Configure Gunicorn ------------------ diff --git a/docs/migrate.rst b/docs/migrate.rst index 78dfb39a6a..03e2aa8514 100644 --- a/docs/migrate.rst +++ b/docs/migrate.rst @@ -12,7 +12,7 @@ In the case that data needs to be migrated from one database installation to ano Export Data ----------- -``python3 manage.py dumpdata --exclude contenttypes --exclude auth.permission --indent 2 > data.json`` +``python3 InvenTree/manage.py dumpdata --exclude contenttypes --exclude auth.permission --indent 2 > data.json`` This will export all data (including user information) to a json data file. @@ -21,13 +21,13 @@ Initialize Database Configure the new database using the normal processes (see `Getting Started `_): -``python3 manage.py makemigrations`` +``python3 InvenTree/manage.py makemigrations`` -``python3 manage.py migrate --run-syncdb`` +``python3 InvenTree/manage.py migrate --run-syncdb`` Import Data ----------- The new database should now be correctly initialized with the correct table structures requried to import the data. -``python3 manage.py loaddata data.json`` \ No newline at end of file +``python3 InvenTree/manage.py loaddata data.json`` \ No newline at end of file From 37507f2b438735a681cd5243edc9a1e86cce1db6 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Mon, 2 Sep 2019 17:43:20 +1000 Subject: [PATCH 7/9] More cleanup of docs --- docs/config.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/config.rst b/docs/config.rst index 1cdb4c3fc6..64667a9cb1 100644 --- a/docs/config.rst +++ b/docs/config.rst @@ -9,9 +9,9 @@ InvenTree Configuration 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. +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``. +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: From 90254d157201e0162125a8b0ddad2167e0482b76 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Mon, 2 Sep 2019 17:46:42 +1000 Subject: [PATCH 8/9] add a note about file encoding --- docs/migrate.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/migrate.rst b/docs/migrate.rst index 03e2aa8514..ccb9341640 100644 --- a/docs/migrate.rst +++ b/docs/migrate.rst @@ -30,4 +30,7 @@ Import Data The new database should now be correctly initialized with the correct table structures requried to import the data. -``python3 InvenTree/manage.py loaddata data.json`` \ No newline at end of file +``python3 InvenTree/manage.py loaddata data.json`` + +.. important:: + If the character encoding of the data file does not exactly match the target database, the import operation may not succeed. In this case, some manual editing of the data file may be required. \ No newline at end of file From c988f9486e2f69dd547d50a2dff7a5ddfc78b122 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Mon, 2 Sep 2019 17:59:10 +1000 Subject: [PATCH 9/9] Re-order docs index --- docs/index.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index 5e7279066f..5e658b8b59 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -10,11 +10,11 @@ InvenTree Source Documentation Getting Started Configuration Deployment + Migrate Data + Backup and Restore Modal Forms Tables REST API - Backup and Restore - Migrate Data InvenTree Modules Module Reference