mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
commit
64278523f0
@ -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
|
||||
|
@ -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:
|
||||
|
||||
|
@ -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
|
||||
------------------
|
||||
|
@ -10,11 +10,11 @@ InvenTree Source Documentation
|
||||
Getting Started<start>
|
||||
Configuration<config>
|
||||
Deployment<deploy>
|
||||
Migrate Data<migrate>
|
||||
Backup and Restore<backup>
|
||||
Modal Forms<forms>
|
||||
Tables<tables>
|
||||
REST API<rest>
|
||||
Backup and Restore<backup>
|
||||
Migrate Data<migrate>
|
||||
InvenTree Modules <modules>
|
||||
Module Reference<reference>
|
||||
|
||||
|
@ -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,16 @@ Initialize Database
|
||||
|
||||
Configure the new database using the normal processes (see `Getting Started <start.html>`_):
|
||||
|
||||
``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``
|
||||
``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.
|
@ -14,10 +14,10 @@ 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
|
||||
* pip3
|
||||
* python3-pip
|
||||
* make
|
||||
|
||||
Installation
|
||||
@ -35,17 +35,17 @@ 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
|
||||
-----------------------
|
||||
|
||||
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 <config.html>`_ section.
|
||||
|
||||
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user