diff --git a/.gitignore b/.gitignore index 25ae56db0a..8cf83e1908 100644 --- a/.gitignore +++ b/.gitignore @@ -31,8 +31,9 @@ local_settings.py # Sphinx files docs/_build -# Local media storage (only when running in development mode) +# Local static and media file storage (only when running in development mode) InvenTree/media +InvenTree/static # Key file secret_key.txt @@ -40,6 +41,7 @@ secret_key.txt # IDE / development files .idea/ *.code-workspace +.vscode/ # Coverage reports .coverage diff --git a/InvenTree/InvenTree/settings.py b/InvenTree/InvenTree/settings.py index 83549d70e2..42d9a4b243 100644 --- a/InvenTree/InvenTree/settings.py +++ b/InvenTree/InvenTree/settings.py @@ -1,42 +1,60 @@ """ Django settings for InvenTree project. -Generated by 'django-admin startproject' using Django 1.10.6. +In practice the settings in this file should not be adjusted, +instead settings can be configured in the config.yaml file +located in the top level project directory. -For more information on this file, see -https://docs.djangoproject.com/en/1.10/topics/settings/ +This allows implementation configuration to be hidden from source control, +as well as separate configuration parameters from the more complex +database setup in this file. -For the full list of settings and their values, see -https://docs.djangoproject.com/en/1.10/ref/settings/ """ import os import logging import tempfile +import yaml # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) +cfg_filename = os.path.join(BASE_DIR, 'config.yaml') -# Quick-start development settings - unsuitable for production -# See https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/ +if not os.path.exists(cfg_filename): + CONFIG = {} + print("Warning: config.yaml not found - using default settings") +else: + with open(cfg_filename, 'r') as cfg: + CONFIG = yaml.safe_load(cfg) -# SECURITY WARNING: keep the secret key used in production secret! +# Read the autogenerated key-file key_file = open(os.path.join(BASE_DIR, 'secret_key.txt'), 'r') SECRET_KEY = key_file.read().strip() +# Default action is to run the system in Debug mode # SECURITY WARNING: don't run with debug turned on in production! -DEBUG = True +DEBUG = CONFIG.get('debug', True) -ALLOWED_HOSTS = ['*'] +# List of allowed hosts (default = allow all) +ALLOWED_HOSTS = CONFIG.get('allowed_hosts', ['*']) -CORS_ORIGIN_WHITELIST = [ -] +# Cross Origin Resource Sharing (CORS) options -if DEBUG: - print("Warning: DEBUG mode is enabled, CORS requests are allowed for any domain") - CORS_ORIGIN_ALLOW_ALL = True +# Only allow CORS access to API +CORS_URLS_REGEX = r'^/api/.*$' + +# Extract CORS options from configuration file +cors_opt = CONFIG.get('cors', None) + +if cors_opt: + CORS_ORIGIN_ALLOW_ALL = cors_opt.get('allow_all', False) + + if CORS_ORIGIN_ALLOW_ALL: + print("Warning: CORS requests are allowed for any domain!") + else: + CORS_ORIGIN_WHITELIST = cors_opt.get('whitelist', []) if DEBUG: # will output to your console @@ -85,17 +103,8 @@ LOGGING = { 'class': 'logging.StreamHandler', }, }, - - # 'loggers': { - # 'ddjango.db.backends': { - # 'level': 'DEBUG', - # 'handlers': ['console',], - # 'propagate': True - # }, - # }, } - MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', @@ -108,7 +117,7 @@ MIDDLEWARE = [ 'InvenTree.middleware.AuthRequiredMiddleware', ] -if DEBUG: +if CONFIG.get('log_queries', False): MIDDLEWARE.append('InvenTree.middleware.QueryCountMiddleware') ROOT_URLCONF = 'InvenTree.urls' @@ -137,32 +146,21 @@ REST_FRAMEWORK = { 'rest_framework.authentication.SessionAuthentication', 'rest_framework.authentication.TokenAuthentication', ) - # 'EXCEPTION_HANDLER': 'InvenTree.utils.api_exception_handler', - # 'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination', - # 'PAGE_SIZE': 50, } WSGI_APPLICATION = 'InvenTree.wsgi.application' +DATABASES = {} -# Database -# https://docs.djangoproject.com/en/1.10/ref/settings/#databases - -DATABASES = { - 'default': { +# Database backend selection +if 'database' in CONFIG: + DATABASES['default'] = CONFIG['database'] +else: + print("Warning: Database backend not specified - using default (sqlite)") + DATABASES['default'] = { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.path.join(BASE_DIR, 'inventree_db.sqlite3'), - }, - # TODO - Uncomment this when postgresql support is re-integrated - # 'postgresql': { - # 'ENGINE': 'django.db.backends.postgresql', - # 'NAME': 'inventree', - # 'USER': 'inventreeuser', - # 'PASSWORD': 'inventree', - # 'HOST': 'localhost', - # 'PORT': '', - # } -} + } CACHES = { 'default': { @@ -177,7 +175,6 @@ CACHES = { QR_CODE_CACHE_ALIAS = 'qr-code' - # Password validation # https://docs.djangoproject.com/en/1.10/ref/settings/#auth-password-validators @@ -216,13 +213,15 @@ USE_TZ = True STATIC_URL = '/static/' +STATIC_ROOT = CONFIG.get('static_root', os.path.join(BASE_DIR, 'static')) + STATICFILES_DIRS = [ - os.path.join(BASE_DIR, 'static'), + os.path.join(BASE_DIR, 'InvenTree', 'static'), ] MEDIA_URL = '/media/' -MEDIA_ROOT = os.path.join(BASE_DIR, 'media') +MEDIA_ROOT = CONFIG.get('media_root', os.path.join(BASE_DIR, 'media')) # crispy forms use the bootstrap templates CRISPY_TEMPLATE_PACK = 'bootstrap' diff --git a/InvenTree/static/css/bootstrap-table-group-by.css b/InvenTree/InvenTree/static/css/bootstrap-table-group-by.css similarity index 100% rename from InvenTree/static/css/bootstrap-table-group-by.css rename to InvenTree/InvenTree/static/css/bootstrap-table-group-by.css diff --git a/InvenTree/static/css/bootstrap-table.css b/InvenTree/InvenTree/static/css/bootstrap-table.css similarity index 100% rename from InvenTree/static/css/bootstrap-table.css rename to InvenTree/InvenTree/static/css/bootstrap-table.css diff --git a/InvenTree/static/css/bootstrap-toggle.css b/InvenTree/InvenTree/static/css/bootstrap-toggle.css similarity index 100% rename from InvenTree/static/css/bootstrap-toggle.css rename to InvenTree/InvenTree/static/css/bootstrap-toggle.css diff --git a/InvenTree/static/css/bootstrap-treeview.css b/InvenTree/InvenTree/static/css/bootstrap-treeview.css similarity index 100% rename from InvenTree/static/css/bootstrap-treeview.css rename to InvenTree/InvenTree/static/css/bootstrap-treeview.css diff --git a/InvenTree/static/css/bootstrap_3.3.7_css_bootstrap.min.css b/InvenTree/InvenTree/static/css/bootstrap_3.3.7_css_bootstrap.min.css similarity index 100% rename from InvenTree/static/css/bootstrap_3.3.7_css_bootstrap.min.css rename to InvenTree/InvenTree/static/css/bootstrap_3.3.7_css_bootstrap.min.css diff --git a/InvenTree/static/css/inventree.css b/InvenTree/InvenTree/static/css/inventree.css similarity index 100% rename from InvenTree/static/css/inventree.css rename to InvenTree/InvenTree/static/css/inventree.css diff --git a/InvenTree/static/css/select2-bootstrap.css b/InvenTree/InvenTree/static/css/select2-bootstrap.css similarity index 100% rename from InvenTree/static/css/select2-bootstrap.css rename to InvenTree/InvenTree/static/css/select2-bootstrap.css diff --git a/InvenTree/static/css/select2.css b/InvenTree/InvenTree/static/css/select2.css similarity index 100% rename from InvenTree/static/css/select2.css rename to InvenTree/InvenTree/static/css/select2.css diff --git a/InvenTree/static/fonts/glyphicons-halflings-regular.eot b/InvenTree/InvenTree/static/fonts/glyphicons-halflings-regular.eot similarity index 100% rename from InvenTree/static/fonts/glyphicons-halflings-regular.eot rename to InvenTree/InvenTree/static/fonts/glyphicons-halflings-regular.eot diff --git a/InvenTree/static/fonts/glyphicons-halflings-regular.svg b/InvenTree/InvenTree/static/fonts/glyphicons-halflings-regular.svg similarity index 100% rename from InvenTree/static/fonts/glyphicons-halflings-regular.svg rename to InvenTree/InvenTree/static/fonts/glyphicons-halflings-regular.svg diff --git a/InvenTree/static/fonts/glyphicons-halflings-regular.ttf b/InvenTree/InvenTree/static/fonts/glyphicons-halflings-regular.ttf similarity index 100% rename from InvenTree/static/fonts/glyphicons-halflings-regular.ttf rename to InvenTree/InvenTree/static/fonts/glyphicons-halflings-regular.ttf diff --git a/InvenTree/static/fonts/glyphicons-halflings-regular.woff b/InvenTree/InvenTree/static/fonts/glyphicons-halflings-regular.woff similarity index 100% rename from InvenTree/static/fonts/glyphicons-halflings-regular.woff rename to InvenTree/InvenTree/static/fonts/glyphicons-halflings-regular.woff diff --git a/InvenTree/static/fonts/glyphicons-halflings-regular.woff2 b/InvenTree/InvenTree/static/fonts/glyphicons-halflings-regular.woff2 similarity index 100% rename from InvenTree/static/fonts/glyphicons-halflings-regular.woff2 rename to InvenTree/InvenTree/static/fonts/glyphicons-halflings-regular.woff2 diff --git a/InvenTree/static/img/blank_image.png b/InvenTree/InvenTree/static/img/blank_image.png similarity index 100% rename from InvenTree/static/img/blank_image.png rename to InvenTree/InvenTree/static/img/blank_image.png diff --git a/InvenTree/static/img/favicon/android-icon-144x144.png b/InvenTree/InvenTree/static/img/favicon/android-icon-144x144.png similarity index 100% rename from InvenTree/static/img/favicon/android-icon-144x144.png rename to InvenTree/InvenTree/static/img/favicon/android-icon-144x144.png diff --git a/InvenTree/static/img/favicon/android-icon-192x192.png b/InvenTree/InvenTree/static/img/favicon/android-icon-192x192.png similarity index 100% rename from InvenTree/static/img/favicon/android-icon-192x192.png rename to InvenTree/InvenTree/static/img/favicon/android-icon-192x192.png diff --git a/InvenTree/static/img/favicon/android-icon-36x36.png b/InvenTree/InvenTree/static/img/favicon/android-icon-36x36.png similarity index 100% rename from InvenTree/static/img/favicon/android-icon-36x36.png rename to InvenTree/InvenTree/static/img/favicon/android-icon-36x36.png diff --git a/InvenTree/static/img/favicon/android-icon-48x48.png b/InvenTree/InvenTree/static/img/favicon/android-icon-48x48.png similarity index 100% rename from InvenTree/static/img/favicon/android-icon-48x48.png rename to InvenTree/InvenTree/static/img/favicon/android-icon-48x48.png diff --git a/InvenTree/static/img/favicon/android-icon-72x72.png b/InvenTree/InvenTree/static/img/favicon/android-icon-72x72.png similarity index 100% rename from InvenTree/static/img/favicon/android-icon-72x72.png rename to InvenTree/InvenTree/static/img/favicon/android-icon-72x72.png diff --git a/InvenTree/static/img/favicon/android-icon-96x96.png b/InvenTree/InvenTree/static/img/favicon/android-icon-96x96.png similarity index 100% rename from InvenTree/static/img/favicon/android-icon-96x96.png rename to InvenTree/InvenTree/static/img/favicon/android-icon-96x96.png diff --git a/InvenTree/static/img/favicon/apple-icon-114x114.png b/InvenTree/InvenTree/static/img/favicon/apple-icon-114x114.png similarity index 100% rename from InvenTree/static/img/favicon/apple-icon-114x114.png rename to InvenTree/InvenTree/static/img/favicon/apple-icon-114x114.png diff --git a/InvenTree/static/img/favicon/apple-icon-120x120.png b/InvenTree/InvenTree/static/img/favicon/apple-icon-120x120.png similarity index 100% rename from InvenTree/static/img/favicon/apple-icon-120x120.png rename to InvenTree/InvenTree/static/img/favicon/apple-icon-120x120.png diff --git a/InvenTree/static/img/favicon/apple-icon-144x144.png b/InvenTree/InvenTree/static/img/favicon/apple-icon-144x144.png similarity index 100% rename from InvenTree/static/img/favicon/apple-icon-144x144.png rename to InvenTree/InvenTree/static/img/favicon/apple-icon-144x144.png diff --git a/InvenTree/static/img/favicon/apple-icon-152x152.png b/InvenTree/InvenTree/static/img/favicon/apple-icon-152x152.png similarity index 100% rename from InvenTree/static/img/favicon/apple-icon-152x152.png rename to InvenTree/InvenTree/static/img/favicon/apple-icon-152x152.png diff --git a/InvenTree/static/img/favicon/apple-icon-180x180.png b/InvenTree/InvenTree/static/img/favicon/apple-icon-180x180.png similarity index 100% rename from InvenTree/static/img/favicon/apple-icon-180x180.png rename to InvenTree/InvenTree/static/img/favicon/apple-icon-180x180.png diff --git a/InvenTree/static/img/favicon/apple-icon-57x57.png b/InvenTree/InvenTree/static/img/favicon/apple-icon-57x57.png similarity index 100% rename from InvenTree/static/img/favicon/apple-icon-57x57.png rename to InvenTree/InvenTree/static/img/favicon/apple-icon-57x57.png diff --git a/InvenTree/static/img/favicon/apple-icon-60x60.png b/InvenTree/InvenTree/static/img/favicon/apple-icon-60x60.png similarity index 100% rename from InvenTree/static/img/favicon/apple-icon-60x60.png rename to InvenTree/InvenTree/static/img/favicon/apple-icon-60x60.png diff --git a/InvenTree/static/img/favicon/apple-icon-72x72.png b/InvenTree/InvenTree/static/img/favicon/apple-icon-72x72.png similarity index 100% rename from InvenTree/static/img/favicon/apple-icon-72x72.png rename to InvenTree/InvenTree/static/img/favicon/apple-icon-72x72.png diff --git a/InvenTree/static/img/favicon/apple-icon-76x76.png b/InvenTree/InvenTree/static/img/favicon/apple-icon-76x76.png similarity index 100% rename from InvenTree/static/img/favicon/apple-icon-76x76.png rename to InvenTree/InvenTree/static/img/favicon/apple-icon-76x76.png diff --git a/InvenTree/static/img/favicon/apple-icon-precomposed.png b/InvenTree/InvenTree/static/img/favicon/apple-icon-precomposed.png similarity index 100% rename from InvenTree/static/img/favicon/apple-icon-precomposed.png rename to InvenTree/InvenTree/static/img/favicon/apple-icon-precomposed.png diff --git a/InvenTree/static/img/favicon/apple-icon.png b/InvenTree/InvenTree/static/img/favicon/apple-icon.png similarity index 100% rename from InvenTree/static/img/favicon/apple-icon.png rename to InvenTree/InvenTree/static/img/favicon/apple-icon.png diff --git a/InvenTree/static/img/favicon/browserconfig.xml b/InvenTree/InvenTree/static/img/favicon/browserconfig.xml similarity index 100% rename from InvenTree/static/img/favicon/browserconfig.xml rename to InvenTree/InvenTree/static/img/favicon/browserconfig.xml diff --git a/InvenTree/static/img/favicon/favicon-16x16.png b/InvenTree/InvenTree/static/img/favicon/favicon-16x16.png similarity index 100% rename from InvenTree/static/img/favicon/favicon-16x16.png rename to InvenTree/InvenTree/static/img/favicon/favicon-16x16.png diff --git a/InvenTree/static/img/favicon/favicon-32x32.png b/InvenTree/InvenTree/static/img/favicon/favicon-32x32.png similarity index 100% rename from InvenTree/static/img/favicon/favicon-32x32.png rename to InvenTree/InvenTree/static/img/favicon/favicon-32x32.png diff --git a/InvenTree/static/img/favicon/favicon-96x96.png b/InvenTree/InvenTree/static/img/favicon/favicon-96x96.png similarity index 100% rename from InvenTree/static/img/favicon/favicon-96x96.png rename to InvenTree/InvenTree/static/img/favicon/favicon-96x96.png diff --git a/InvenTree/static/img/favicon/favicon.ico b/InvenTree/InvenTree/static/img/favicon/favicon.ico similarity index 100% rename from InvenTree/static/img/favicon/favicon.ico rename to InvenTree/InvenTree/static/img/favicon/favicon.ico diff --git a/InvenTree/static/img/favicon/manifest.json b/InvenTree/InvenTree/static/img/favicon/manifest.json similarity index 100% rename from InvenTree/static/img/favicon/manifest.json rename to InvenTree/InvenTree/static/img/favicon/manifest.json diff --git a/InvenTree/static/img/favicon/ms-icon-144x144.png b/InvenTree/InvenTree/static/img/favicon/ms-icon-144x144.png similarity index 100% rename from InvenTree/static/img/favicon/ms-icon-144x144.png rename to InvenTree/InvenTree/static/img/favicon/ms-icon-144x144.png diff --git a/InvenTree/static/img/favicon/ms-icon-150x150.png b/InvenTree/InvenTree/static/img/favicon/ms-icon-150x150.png similarity index 100% rename from InvenTree/static/img/favicon/ms-icon-150x150.png rename to InvenTree/InvenTree/static/img/favicon/ms-icon-150x150.png diff --git a/InvenTree/static/img/favicon/ms-icon-310x310.png b/InvenTree/InvenTree/static/img/favicon/ms-icon-310x310.png similarity index 100% rename from InvenTree/static/img/favicon/ms-icon-310x310.png rename to InvenTree/InvenTree/static/img/favicon/ms-icon-310x310.png diff --git a/InvenTree/static/img/favicon/ms-icon-70x70.png b/InvenTree/InvenTree/static/img/favicon/ms-icon-70x70.png similarity index 100% rename from InvenTree/static/img/favicon/ms-icon-70x70.png rename to InvenTree/InvenTree/static/img/favicon/ms-icon-70x70.png diff --git a/InvenTree/static/img/inventree.png b/InvenTree/InvenTree/static/img/inventree.png similarity index 100% rename from InvenTree/static/img/inventree.png rename to InvenTree/InvenTree/static/img/inventree.png diff --git a/InvenTree/static/script/bootstrap/bootstrap-table-en-US.min.js b/InvenTree/InvenTree/static/script/bootstrap/bootstrap-table-en-US.min.js similarity index 100% rename from InvenTree/static/script/bootstrap/bootstrap-table-en-US.min.js rename to InvenTree/InvenTree/static/script/bootstrap/bootstrap-table-en-US.min.js diff --git a/InvenTree/static/script/bootstrap/bootstrap-table-group-by.js b/InvenTree/InvenTree/static/script/bootstrap/bootstrap-table-group-by.js similarity index 100% rename from InvenTree/static/script/bootstrap/bootstrap-table-group-by.js rename to InvenTree/InvenTree/static/script/bootstrap/bootstrap-table-group-by.js diff --git a/InvenTree/static/script/bootstrap/bootstrap-table.js b/InvenTree/InvenTree/static/script/bootstrap/bootstrap-table.js similarity index 100% rename from InvenTree/static/script/bootstrap/bootstrap-table.js rename to InvenTree/InvenTree/static/script/bootstrap/bootstrap-table.js diff --git a/InvenTree/static/script/bootstrap/bootstrap-toggle.js b/InvenTree/InvenTree/static/script/bootstrap/bootstrap-toggle.js similarity index 100% rename from InvenTree/static/script/bootstrap/bootstrap-toggle.js rename to InvenTree/InvenTree/static/script/bootstrap/bootstrap-toggle.js diff --git a/InvenTree/static/script/bootstrap/bootstrap-treeview.js b/InvenTree/InvenTree/static/script/bootstrap/bootstrap-treeview.js similarity index 100% rename from InvenTree/static/script/bootstrap/bootstrap-treeview.js rename to InvenTree/InvenTree/static/script/bootstrap/bootstrap-treeview.js diff --git a/InvenTree/static/script/bootstrap/bootstrap.min.js b/InvenTree/InvenTree/static/script/bootstrap/bootstrap.min.js similarity index 100% rename from InvenTree/static/script/bootstrap/bootstrap.min.js rename to InvenTree/InvenTree/static/script/bootstrap/bootstrap.min.js diff --git a/InvenTree/static/script/inventree/api.js b/InvenTree/InvenTree/static/script/inventree/api.js similarity index 100% rename from InvenTree/static/script/inventree/api.js rename to InvenTree/InvenTree/static/script/inventree/api.js diff --git a/InvenTree/static/script/inventree/bom.js b/InvenTree/InvenTree/static/script/inventree/bom.js similarity index 100% rename from InvenTree/static/script/inventree/bom.js rename to InvenTree/InvenTree/static/script/inventree/bom.js diff --git a/InvenTree/static/script/inventree/build.js b/InvenTree/InvenTree/static/script/inventree/build.js similarity index 100% rename from InvenTree/static/script/inventree/build.js rename to InvenTree/InvenTree/static/script/inventree/build.js diff --git a/InvenTree/static/script/inventree/delay.js b/InvenTree/InvenTree/static/script/inventree/delay.js similarity index 100% rename from InvenTree/static/script/inventree/delay.js rename to InvenTree/InvenTree/static/script/inventree/delay.js diff --git a/InvenTree/static/script/inventree/inventree.js b/InvenTree/InvenTree/static/script/inventree/inventree.js similarity index 100% rename from InvenTree/static/script/inventree/inventree.js rename to InvenTree/InvenTree/static/script/inventree/inventree.js diff --git a/InvenTree/static/script/inventree/modals.js b/InvenTree/InvenTree/static/script/inventree/modals.js similarity index 100% rename from InvenTree/static/script/inventree/modals.js rename to InvenTree/InvenTree/static/script/inventree/modals.js diff --git a/InvenTree/static/script/inventree/notification.js b/InvenTree/InvenTree/static/script/inventree/notification.js similarity index 100% rename from InvenTree/static/script/inventree/notification.js rename to InvenTree/InvenTree/static/script/inventree/notification.js diff --git a/InvenTree/static/script/inventree/order.js b/InvenTree/InvenTree/static/script/inventree/order.js similarity index 100% rename from InvenTree/static/script/inventree/order.js rename to InvenTree/InvenTree/static/script/inventree/order.js diff --git a/InvenTree/static/script/inventree/part.js b/InvenTree/InvenTree/static/script/inventree/part.js similarity index 100% rename from InvenTree/static/script/inventree/part.js rename to InvenTree/InvenTree/static/script/inventree/part.js diff --git a/InvenTree/static/script/inventree/sidenav.js b/InvenTree/InvenTree/static/script/inventree/sidenav.js similarity index 100% rename from InvenTree/static/script/inventree/sidenav.js rename to InvenTree/InvenTree/static/script/inventree/sidenav.js diff --git a/InvenTree/static/script/inventree/stock.js b/InvenTree/InvenTree/static/script/inventree/stock.js similarity index 100% rename from InvenTree/static/script/inventree/stock.js rename to InvenTree/InvenTree/static/script/inventree/stock.js diff --git a/InvenTree/static/script/inventree/tables.js b/InvenTree/InvenTree/static/script/inventree/tables.js similarity index 100% rename from InvenTree/static/script/inventree/tables.js rename to InvenTree/InvenTree/static/script/inventree/tables.js diff --git a/InvenTree/static/script/jquery.form.min.js b/InvenTree/InvenTree/static/script/jquery.form.min.js similarity index 100% rename from InvenTree/static/script/jquery.form.min.js rename to InvenTree/InvenTree/static/script/jquery.form.min.js diff --git a/InvenTree/static/script/jquery_3.3.1_jquery.min.js b/InvenTree/InvenTree/static/script/jquery_3.3.1_jquery.min.js similarity index 100% rename from InvenTree/static/script/jquery_3.3.1_jquery.min.js rename to InvenTree/InvenTree/static/script/jquery_3.3.1_jquery.min.js diff --git a/InvenTree/static/script/moment.js b/InvenTree/InvenTree/static/script/moment.js similarity index 100% rename from InvenTree/static/script/moment.js rename to InvenTree/InvenTree/static/script/moment.js diff --git a/InvenTree/static/script/select2/i18n/af.js b/InvenTree/InvenTree/static/script/select2/i18n/af.js similarity index 100% rename from InvenTree/static/script/select2/i18n/af.js rename to InvenTree/InvenTree/static/script/select2/i18n/af.js diff --git a/InvenTree/static/script/select2/i18n/ar.js b/InvenTree/InvenTree/static/script/select2/i18n/ar.js similarity index 100% rename from InvenTree/static/script/select2/i18n/ar.js rename to InvenTree/InvenTree/static/script/select2/i18n/ar.js diff --git a/InvenTree/static/script/select2/i18n/az.js b/InvenTree/InvenTree/static/script/select2/i18n/az.js similarity index 100% rename from InvenTree/static/script/select2/i18n/az.js rename to InvenTree/InvenTree/static/script/select2/i18n/az.js diff --git a/InvenTree/static/script/select2/i18n/bg.js b/InvenTree/InvenTree/static/script/select2/i18n/bg.js similarity index 100% rename from InvenTree/static/script/select2/i18n/bg.js rename to InvenTree/InvenTree/static/script/select2/i18n/bg.js diff --git a/InvenTree/static/script/select2/i18n/bs.js b/InvenTree/InvenTree/static/script/select2/i18n/bs.js similarity index 100% rename from InvenTree/static/script/select2/i18n/bs.js rename to InvenTree/InvenTree/static/script/select2/i18n/bs.js diff --git a/InvenTree/static/script/select2/i18n/ca.js b/InvenTree/InvenTree/static/script/select2/i18n/ca.js similarity index 100% rename from InvenTree/static/script/select2/i18n/ca.js rename to InvenTree/InvenTree/static/script/select2/i18n/ca.js diff --git a/InvenTree/static/script/select2/i18n/cs.js b/InvenTree/InvenTree/static/script/select2/i18n/cs.js similarity index 100% rename from InvenTree/static/script/select2/i18n/cs.js rename to InvenTree/InvenTree/static/script/select2/i18n/cs.js diff --git a/InvenTree/static/script/select2/i18n/da.js b/InvenTree/InvenTree/static/script/select2/i18n/da.js similarity index 100% rename from InvenTree/static/script/select2/i18n/da.js rename to InvenTree/InvenTree/static/script/select2/i18n/da.js diff --git a/InvenTree/static/script/select2/i18n/de.js b/InvenTree/InvenTree/static/script/select2/i18n/de.js similarity index 100% rename from InvenTree/static/script/select2/i18n/de.js rename to InvenTree/InvenTree/static/script/select2/i18n/de.js diff --git a/InvenTree/static/script/select2/i18n/dsb.js b/InvenTree/InvenTree/static/script/select2/i18n/dsb.js similarity index 100% rename from InvenTree/static/script/select2/i18n/dsb.js rename to InvenTree/InvenTree/static/script/select2/i18n/dsb.js diff --git a/InvenTree/static/script/select2/i18n/el.js b/InvenTree/InvenTree/static/script/select2/i18n/el.js similarity index 100% rename from InvenTree/static/script/select2/i18n/el.js rename to InvenTree/InvenTree/static/script/select2/i18n/el.js diff --git a/InvenTree/static/script/select2/i18n/en.js b/InvenTree/InvenTree/static/script/select2/i18n/en.js similarity index 100% rename from InvenTree/static/script/select2/i18n/en.js rename to InvenTree/InvenTree/static/script/select2/i18n/en.js diff --git a/InvenTree/static/script/select2/i18n/es.js b/InvenTree/InvenTree/static/script/select2/i18n/es.js similarity index 100% rename from InvenTree/static/script/select2/i18n/es.js rename to InvenTree/InvenTree/static/script/select2/i18n/es.js diff --git a/InvenTree/static/script/select2/i18n/et.js b/InvenTree/InvenTree/static/script/select2/i18n/et.js similarity index 100% rename from InvenTree/static/script/select2/i18n/et.js rename to InvenTree/InvenTree/static/script/select2/i18n/et.js diff --git a/InvenTree/static/script/select2/i18n/eu.js b/InvenTree/InvenTree/static/script/select2/i18n/eu.js similarity index 100% rename from InvenTree/static/script/select2/i18n/eu.js rename to InvenTree/InvenTree/static/script/select2/i18n/eu.js diff --git a/InvenTree/static/script/select2/i18n/fa.js b/InvenTree/InvenTree/static/script/select2/i18n/fa.js similarity index 100% rename from InvenTree/static/script/select2/i18n/fa.js rename to InvenTree/InvenTree/static/script/select2/i18n/fa.js diff --git a/InvenTree/static/script/select2/i18n/fi.js b/InvenTree/InvenTree/static/script/select2/i18n/fi.js similarity index 100% rename from InvenTree/static/script/select2/i18n/fi.js rename to InvenTree/InvenTree/static/script/select2/i18n/fi.js diff --git a/InvenTree/static/script/select2/i18n/fr.js b/InvenTree/InvenTree/static/script/select2/i18n/fr.js similarity index 100% rename from InvenTree/static/script/select2/i18n/fr.js rename to InvenTree/InvenTree/static/script/select2/i18n/fr.js diff --git a/InvenTree/static/script/select2/i18n/gl.js b/InvenTree/InvenTree/static/script/select2/i18n/gl.js similarity index 100% rename from InvenTree/static/script/select2/i18n/gl.js rename to InvenTree/InvenTree/static/script/select2/i18n/gl.js diff --git a/InvenTree/static/script/select2/i18n/he.js b/InvenTree/InvenTree/static/script/select2/i18n/he.js similarity index 100% rename from InvenTree/static/script/select2/i18n/he.js rename to InvenTree/InvenTree/static/script/select2/i18n/he.js diff --git a/InvenTree/static/script/select2/i18n/hi.js b/InvenTree/InvenTree/static/script/select2/i18n/hi.js similarity index 100% rename from InvenTree/static/script/select2/i18n/hi.js rename to InvenTree/InvenTree/static/script/select2/i18n/hi.js diff --git a/InvenTree/static/script/select2/i18n/hr.js b/InvenTree/InvenTree/static/script/select2/i18n/hr.js similarity index 100% rename from InvenTree/static/script/select2/i18n/hr.js rename to InvenTree/InvenTree/static/script/select2/i18n/hr.js diff --git a/InvenTree/static/script/select2/i18n/hsb.js b/InvenTree/InvenTree/static/script/select2/i18n/hsb.js similarity index 100% rename from InvenTree/static/script/select2/i18n/hsb.js rename to InvenTree/InvenTree/static/script/select2/i18n/hsb.js diff --git a/InvenTree/static/script/select2/i18n/hu.js b/InvenTree/InvenTree/static/script/select2/i18n/hu.js similarity index 100% rename from InvenTree/static/script/select2/i18n/hu.js rename to InvenTree/InvenTree/static/script/select2/i18n/hu.js diff --git a/InvenTree/static/script/select2/i18n/hy.js b/InvenTree/InvenTree/static/script/select2/i18n/hy.js similarity index 100% rename from InvenTree/static/script/select2/i18n/hy.js rename to InvenTree/InvenTree/static/script/select2/i18n/hy.js diff --git a/InvenTree/static/script/select2/i18n/id.js b/InvenTree/InvenTree/static/script/select2/i18n/id.js similarity index 100% rename from InvenTree/static/script/select2/i18n/id.js rename to InvenTree/InvenTree/static/script/select2/i18n/id.js diff --git a/InvenTree/static/script/select2/i18n/is.js b/InvenTree/InvenTree/static/script/select2/i18n/is.js similarity index 100% rename from InvenTree/static/script/select2/i18n/is.js rename to InvenTree/InvenTree/static/script/select2/i18n/is.js diff --git a/InvenTree/static/script/select2/i18n/it.js b/InvenTree/InvenTree/static/script/select2/i18n/it.js similarity index 100% rename from InvenTree/static/script/select2/i18n/it.js rename to InvenTree/InvenTree/static/script/select2/i18n/it.js diff --git a/InvenTree/static/script/select2/i18n/ja.js b/InvenTree/InvenTree/static/script/select2/i18n/ja.js similarity index 100% rename from InvenTree/static/script/select2/i18n/ja.js rename to InvenTree/InvenTree/static/script/select2/i18n/ja.js diff --git a/InvenTree/static/script/select2/i18n/km.js b/InvenTree/InvenTree/static/script/select2/i18n/km.js similarity index 100% rename from InvenTree/static/script/select2/i18n/km.js rename to InvenTree/InvenTree/static/script/select2/i18n/km.js diff --git a/InvenTree/static/script/select2/i18n/ko.js b/InvenTree/InvenTree/static/script/select2/i18n/ko.js similarity index 100% rename from InvenTree/static/script/select2/i18n/ko.js rename to InvenTree/InvenTree/static/script/select2/i18n/ko.js diff --git a/InvenTree/static/script/select2/i18n/lt.js b/InvenTree/InvenTree/static/script/select2/i18n/lt.js similarity index 100% rename from InvenTree/static/script/select2/i18n/lt.js rename to InvenTree/InvenTree/static/script/select2/i18n/lt.js diff --git a/InvenTree/static/script/select2/i18n/lv.js b/InvenTree/InvenTree/static/script/select2/i18n/lv.js similarity index 100% rename from InvenTree/static/script/select2/i18n/lv.js rename to InvenTree/InvenTree/static/script/select2/i18n/lv.js diff --git a/InvenTree/static/script/select2/i18n/mk.js b/InvenTree/InvenTree/static/script/select2/i18n/mk.js similarity index 100% rename from InvenTree/static/script/select2/i18n/mk.js rename to InvenTree/InvenTree/static/script/select2/i18n/mk.js diff --git a/InvenTree/static/script/select2/i18n/ms.js b/InvenTree/InvenTree/static/script/select2/i18n/ms.js similarity index 100% rename from InvenTree/static/script/select2/i18n/ms.js rename to InvenTree/InvenTree/static/script/select2/i18n/ms.js diff --git a/InvenTree/static/script/select2/i18n/nb.js b/InvenTree/InvenTree/static/script/select2/i18n/nb.js similarity index 100% rename from InvenTree/static/script/select2/i18n/nb.js rename to InvenTree/InvenTree/static/script/select2/i18n/nb.js diff --git a/InvenTree/static/script/select2/i18n/nl.js b/InvenTree/InvenTree/static/script/select2/i18n/nl.js similarity index 100% rename from InvenTree/static/script/select2/i18n/nl.js rename to InvenTree/InvenTree/static/script/select2/i18n/nl.js diff --git a/InvenTree/static/script/select2/i18n/pl.js b/InvenTree/InvenTree/static/script/select2/i18n/pl.js similarity index 100% rename from InvenTree/static/script/select2/i18n/pl.js rename to InvenTree/InvenTree/static/script/select2/i18n/pl.js diff --git a/InvenTree/static/script/select2/i18n/ps.js b/InvenTree/InvenTree/static/script/select2/i18n/ps.js similarity index 100% rename from InvenTree/static/script/select2/i18n/ps.js rename to InvenTree/InvenTree/static/script/select2/i18n/ps.js diff --git a/InvenTree/static/script/select2/i18n/pt-BR.js b/InvenTree/InvenTree/static/script/select2/i18n/pt-BR.js similarity index 100% rename from InvenTree/static/script/select2/i18n/pt-BR.js rename to InvenTree/InvenTree/static/script/select2/i18n/pt-BR.js diff --git a/InvenTree/static/script/select2/i18n/pt.js b/InvenTree/InvenTree/static/script/select2/i18n/pt.js similarity index 100% rename from InvenTree/static/script/select2/i18n/pt.js rename to InvenTree/InvenTree/static/script/select2/i18n/pt.js diff --git a/InvenTree/static/script/select2/i18n/ro.js b/InvenTree/InvenTree/static/script/select2/i18n/ro.js similarity index 100% rename from InvenTree/static/script/select2/i18n/ro.js rename to InvenTree/InvenTree/static/script/select2/i18n/ro.js diff --git a/InvenTree/static/script/select2/i18n/ru.js b/InvenTree/InvenTree/static/script/select2/i18n/ru.js similarity index 100% rename from InvenTree/static/script/select2/i18n/ru.js rename to InvenTree/InvenTree/static/script/select2/i18n/ru.js diff --git a/InvenTree/static/script/select2/i18n/sk.js b/InvenTree/InvenTree/static/script/select2/i18n/sk.js similarity index 100% rename from InvenTree/static/script/select2/i18n/sk.js rename to InvenTree/InvenTree/static/script/select2/i18n/sk.js diff --git a/InvenTree/static/script/select2/i18n/sl.js b/InvenTree/InvenTree/static/script/select2/i18n/sl.js similarity index 100% rename from InvenTree/static/script/select2/i18n/sl.js rename to InvenTree/InvenTree/static/script/select2/i18n/sl.js diff --git a/InvenTree/static/script/select2/i18n/sr-Cyrl.js b/InvenTree/InvenTree/static/script/select2/i18n/sr-Cyrl.js similarity index 100% rename from InvenTree/static/script/select2/i18n/sr-Cyrl.js rename to InvenTree/InvenTree/static/script/select2/i18n/sr-Cyrl.js diff --git a/InvenTree/static/script/select2/i18n/sr.js b/InvenTree/InvenTree/static/script/select2/i18n/sr.js similarity index 100% rename from InvenTree/static/script/select2/i18n/sr.js rename to InvenTree/InvenTree/static/script/select2/i18n/sr.js diff --git a/InvenTree/static/script/select2/i18n/sv.js b/InvenTree/InvenTree/static/script/select2/i18n/sv.js similarity index 100% rename from InvenTree/static/script/select2/i18n/sv.js rename to InvenTree/InvenTree/static/script/select2/i18n/sv.js diff --git a/InvenTree/static/script/select2/i18n/th.js b/InvenTree/InvenTree/static/script/select2/i18n/th.js similarity index 100% rename from InvenTree/static/script/select2/i18n/th.js rename to InvenTree/InvenTree/static/script/select2/i18n/th.js diff --git a/InvenTree/static/script/select2/i18n/tr.js b/InvenTree/InvenTree/static/script/select2/i18n/tr.js similarity index 100% rename from InvenTree/static/script/select2/i18n/tr.js rename to InvenTree/InvenTree/static/script/select2/i18n/tr.js diff --git a/InvenTree/static/script/select2/i18n/uk.js b/InvenTree/InvenTree/static/script/select2/i18n/uk.js similarity index 100% rename from InvenTree/static/script/select2/i18n/uk.js rename to InvenTree/InvenTree/static/script/select2/i18n/uk.js diff --git a/InvenTree/static/script/select2/i18n/vi.js b/InvenTree/InvenTree/static/script/select2/i18n/vi.js similarity index 100% rename from InvenTree/static/script/select2/i18n/vi.js rename to InvenTree/InvenTree/static/script/select2/i18n/vi.js diff --git a/InvenTree/static/script/select2/i18n/zh-CN.js b/InvenTree/InvenTree/static/script/select2/i18n/zh-CN.js similarity index 100% rename from InvenTree/static/script/select2/i18n/zh-CN.js rename to InvenTree/InvenTree/static/script/select2/i18n/zh-CN.js diff --git a/InvenTree/static/script/select2/i18n/zh-TW.js b/InvenTree/InvenTree/static/script/select2/i18n/zh-TW.js similarity index 100% rename from InvenTree/static/script/select2/i18n/zh-TW.js rename to InvenTree/InvenTree/static/script/select2/i18n/zh-TW.js diff --git a/InvenTree/static/script/select2/select2.full.js b/InvenTree/InvenTree/static/script/select2/select2.full.js similarity index 100% rename from InvenTree/static/script/select2/select2.full.js rename to InvenTree/InvenTree/static/script/select2/select2.full.js diff --git a/InvenTree/static/script/select2/select2.full.min.js b/InvenTree/InvenTree/static/script/select2/select2.full.min.js similarity index 100% rename from InvenTree/static/script/select2/select2.full.min.js rename to InvenTree/InvenTree/static/script/select2/select2.full.min.js diff --git a/InvenTree/static/script/select2/select2.js b/InvenTree/InvenTree/static/script/select2/select2.js similarity index 100% rename from InvenTree/static/script/select2/select2.js rename to InvenTree/InvenTree/static/script/select2/select2.js diff --git a/InvenTree/static/script/select2/select2.min.js b/InvenTree/InvenTree/static/script/select2/select2.min.js similarity index 100% rename from InvenTree/static/script/select2/select2.min.js rename to InvenTree/InvenTree/static/script/select2/select2.min.js diff --git a/InvenTree/company/views.py b/InvenTree/company/views.py index c3cda22e39..e69f7691cf 100644 --- a/InvenTree/company/views.py +++ b/InvenTree/company/views.py @@ -235,8 +235,6 @@ class PriceBreakCreate(AjaxCreateView): initials = super(AjaxCreateView, self).get_initial() - print("GETTING INITIAL DAtA") - initials['part'] = self.get_part() return initials diff --git a/InvenTree/config.yaml b/InvenTree/config.yaml new file mode 100644 index 0000000000..5aa24a3e69 --- /dev/null +++ b/InvenTree/config.yaml @@ -0,0 +1,46 @@ + +# Database backend selection - Configure backend database settings +# Ref: https://docs.djangoproject.com/en/2.2/ref/settings/#std:setting-DATABASES +# Specify database parameters below as they appear in the Django docs +database: + ENGINE: django.db.backends.sqlite3 + NAME: inventree_db.sqlite3 + + # For more complex database installations, further parameters are required + # Refer to the django documentation for full list of options + # USER: db_username + # PASSWORD: db_password + # HOST: db_hostname + # PORT: db_port + +# Set debug to False to run in production mode +debug: True + +# Allowed hosts (see ALLOWED_HOSTS in Django settings documentation) +# A list of strings representing the host/domain names that this Django site can serve. +# Default behaviour is to allow all hosts (THIS IS NOT SECURE!) +allowed_hosts: + - '*' + +# Cross Origin Resource Sharing (CORS) settings (see https://github.com/ottoyiu/django-cors-headers) +# Following parameters are +cors: + # CORS_ORIGIN_ALLOW_ALL - If True, the whitelist will not be used and all origins will be accepted. + allow_all: True + + # CORS_ORIGIN_WHITELIST - A list of origins that are authorized to make cross-site HTTP requests. Defaults to [] + # whitelist: + # - https://example.com + # - https://sub.example.com + +# MEDIA_ROOT is the local filesystem location for storing uploaded files +# By default, it is stored in a directory named 'media' local to the InvenTree directory +# This should be changed for a production installation +media_root: './media' + +# STATIC_ROOT is the local filesystem location for storing static files +# By default it is stored in a directory named 'static' local to the InvenTree directory +static_root: './static' + +# Logging options +log_queries: False \ No newline at end of file diff --git a/InvenTree/gunicorn.conf.py b/InvenTree/gunicorn.conf.py new file mode 100644 index 0000000000..aeee2a366b --- /dev/null +++ b/InvenTree/gunicorn.conf.py @@ -0,0 +1,5 @@ +import multiprocessing + +bind = "0.0.0.0:8000" + +workers = multiprocessing.cpu_count() * 2 + 1 diff --git a/InvenTree/part/bom.py b/InvenTree/part/bom.py index a96c331a4b..1a37aa92d0 100644 --- a/InvenTree/part/bom.py +++ b/InvenTree/part/bom.py @@ -176,13 +176,12 @@ class BomUploadManager: try: # Excel import casts number-looking-items into floats, which is annoying if item == int(item) and not str(item) == str(int(item)): - print("converting", item, "to", int(item)) data[idx] = int(item) except ValueError: pass + # Skip empty rows if empty: - print("Empty - continuing") continue row = { diff --git a/InvenTree/stock/models.py b/InvenTree/stock/models.py index e992b4eb9f..34dcd00464 100644 --- a/InvenTree/stock/models.py +++ b/InvenTree/stock/models.py @@ -147,8 +147,6 @@ class StockItem(models.Model): - Quantity must be 1 if the StockItem has a serial number """ - print("Trying to clean the StockItem") - # The 'supplier_part' field must point to the same part! try: if self.supplier_part is not None: diff --git a/docs/config.rst b/docs/config.rst new file mode 100644 index 0000000000..d8388ae155 --- /dev/null +++ b/docs/config.rst @@ -0,0 +1,50 @@ +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. + +Allowed Hosts / CORS +-------------------- + +By default, all hosts are allowed, and CORS requests are enabled from any origin. **This is not secure and should be adjusted for your installation**. These options can be changed in the configuration file. + +For further information, refer to the following documentation: + +* `Django ALLOWED_HOSTS `_ +* `Django CORS headers `_ + +Uploaded File Storage +--------------------- + +By default, uploaded files are stored in the local direction ``./media``. This directory should be changed based on the particular installation requirements. \ No newline at end of file diff --git a/docs/deploy.rst b/docs/deploy.rst new file mode 100644 index 0000000000..2ce5e7b255 --- /dev/null +++ b/docs/deploy.rst @@ -0,0 +1,52 @@ +Deploying InvenTree +=================== + +.. toctree:: + :titlesonly: + :maxdepth: 2 + :caption: Deployment + :hidden: + +The development server provided by the Django ecosystem may be fine for a testing environment or small contained setups. However special consideration must be given when deploying InvenTree in a real-world environment. + +Django apps provide multiple deployment methods - see the `Django documentation `_. + +There are also numerous online tutorials describing how to deploy a Django application either locally or on an online platform. + +Following is a simple tutorial on serving InvenTree using `Gunicorn `_. Gunicorn is a Python WSGI server which provides a multi-worker server which is much better suited to handling multiple simultaneous requests. + +Install Gunicorn +---------------- + +Gunicorn can be installed using PIP: + +``pip3 install gunicorn`` + + +Configure Static Directories +---------------------------- + +Directories for storing *media* files and *static* files should be specified in the ``config.yaml`` configuration file. These directories are the ``MEDIA_ROOT`` and ``STATIC_ROOT`` paths required by the Django app. + +Collect Static Files +-------------------- + +The required static files must be collected into the specified ``STATIC_ROOT`` directory. Run ``python3 manage.py collectstatic`` + +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`` + +.. literalinclude :: ../InvenTree/gunicorn.conf.py + :language: python + :linenos: + +This file can be used to configure the Gunicorn server to match particular requirements. + +Run Gunicorn +------------ + +From the directory where ``manage.py`` is located: + +Run ``gunicorn -c gunicorn.conf.py InvenTree.wsgi`` \ No newline at end of file diff --git a/docs/forms.rst b/docs/forms.rst index a9c56cf64b..9bdb0dc7a6 100644 --- a/docs/forms.rst +++ b/docs/forms.rst @@ -3,7 +3,7 @@ InvenTree Modal Forms .. toctree:: :titlesonly: - :maxdepth: 1 + :maxdepth: 2 :caption: Modal Forms :hidden: diff --git a/docs/index.rst b/docs/index.rst index 34ebc992b0..c90ff2fe25 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -8,6 +8,8 @@ InvenTree Source Documentation :hidden: Getting Started + Configuration + Deployment Modal Forms Tables REST API diff --git a/docs/reference.rst b/docs/reference.rst index bbf9958fcb..5a45ca9177 100644 --- a/docs/reference.rst +++ b/docs/reference.rst @@ -3,7 +3,7 @@ Module Reference .. toctree:: :titlesonly: - :maxdepth: 1 + :maxdepth: 2 :caption: Module Reference :hidden: 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 -----------------