mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Remove invoke tasks which perform system commands
- tasks.py is now for InvenTree specific tasks only
This commit is contained in:
parent
ce64feb79d
commit
df0ab2359f
@ -45,7 +45,6 @@ def get_setting(environment_var, backup_val, default_value=None):
|
|||||||
|
|
||||||
return default_value
|
return default_value
|
||||||
|
|
||||||
|
|
||||||
# Determine if we are running in "test" mode e.g. "manage.py test"
|
# Determine if we are running in "test" mode e.g. "manage.py test"
|
||||||
TESTING = 'test' in sys.argv
|
TESTING = 'test' in sys.argv
|
||||||
|
|
||||||
|
@ -7,11 +7,9 @@
|
|||||||
# with the prefix INVENTREE_DB_
|
# with the prefix INVENTREE_DB_
|
||||||
# e.g INVENTREE_DB_NAME / INVENTREE_DB_USER / INVENTREE_DB_PASSWORD
|
# e.g INVENTREE_DB_NAME / INVENTREE_DB_USER / INVENTREE_DB_PASSWORD
|
||||||
database:
|
database:
|
||||||
# Default configuration - sqlite filesystem database
|
# Uncomment (and edit) one of the database configurations below,
|
||||||
ENGINE: sqlite3
|
# or specify database options using environment variables
|
||||||
NAME: '../inventree_default_db.sqlite3'
|
|
||||||
|
|
||||||
# For more complex database installations, further parameters are required
|
|
||||||
# Refer to the django documentation for full list of options
|
# Refer to the django documentation for full list of options
|
||||||
|
|
||||||
# --- Available options: ---
|
# --- Available options: ---
|
||||||
@ -27,14 +25,22 @@ database:
|
|||||||
|
|
||||||
# --- Example Configuration - sqlite3 ---
|
# --- Example Configuration - sqlite3 ---
|
||||||
# ENGINE: sqlite3
|
# ENGINE: sqlite3
|
||||||
# NAME: '/path/to/database.sqlite3'
|
# NAME: '/home/inventree/database.sqlite3'
|
||||||
|
|
||||||
# --- Example Configuration - MySQL ---
|
# --- Example Configuration - MySQL ---
|
||||||
#ENGINE: django.db.backends.mysql
|
#ENGINE: django.db.backends.mysql
|
||||||
#NAME: inventree
|
#NAME: inventree
|
||||||
#USER: inventree_username
|
#USER: inventree
|
||||||
#PASSWORD: inventree_password
|
#PASSWORD: inventree_password
|
||||||
#HOST: '127.0.0.1'
|
#HOST: 'localhost'
|
||||||
|
#PORT: '3306'
|
||||||
|
|
||||||
|
# --- Example Configuration - Postgresql ---
|
||||||
|
#ENGINE: django.db.backends.postgresql
|
||||||
|
#NAME: inventree
|
||||||
|
#USER: inventree
|
||||||
|
#PASSWORD: inventree_password
|
||||||
|
#HOST: 'localhost'
|
||||||
#PORT: '5432'
|
#PORT: '5432'
|
||||||
|
|
||||||
# Select default system language (default is 'en-us')
|
# Select default system language (default is 'en-us')
|
||||||
@ -86,13 +92,12 @@ cors:
|
|||||||
# - https://sub.example.com
|
# - https://sub.example.com
|
||||||
|
|
||||||
# MEDIA_ROOT is the local filesystem location for storing uploaded files
|
# MEDIA_ROOT is the local filesystem location for storing uploaded files
|
||||||
# By default, it is stored in a directory named 'inventree_media' local to the InvenTree directory
|
# By default, it is stored under /home/inventree
|
||||||
# This should be changed for a production installation
|
media_root: '/home/inventree/media'
|
||||||
media_root: '../inventree_media'
|
|
||||||
|
|
||||||
# STATIC_ROOT is the local filesystem location for storing static files
|
# STATIC_ROOT is the local filesystem location for storing static files
|
||||||
# By default it is stored in a directory named 'inventree_static' local to the InvenTree directory
|
# By default, it is stored under /home/inventree
|
||||||
static_root: '../inventree_static'
|
static_root: '/home/inventree/static'
|
||||||
|
|
||||||
# Optional URL schemes to allow in URL fields
|
# Optional URL schemes to allow in URL fields
|
||||||
# By default, only the following schemes are allowed: ['http', 'https', 'ftp', 'ftps']
|
# By default, only the following schemes are allowed: ['http', 'https', 'ftp', 'ftps']
|
||||||
@ -105,7 +110,7 @@ static_root: '../inventree_static'
|
|||||||
# Backup options
|
# Backup options
|
||||||
# Set the backup_dir parameter to store backup files in a specific location
|
# Set the backup_dir parameter to store backup files in a specific location
|
||||||
# If unspecified, the local user's temp directory will be used
|
# If unspecified, the local user's temp directory will be used
|
||||||
#backup_dir: '/home/inventree/backup/'
|
backup_dir: '/home/inventree/backup/'
|
||||||
|
|
||||||
# Permit custom authentication backends
|
# Permit custom authentication backends
|
||||||
#authentication_backends:
|
#authentication_backends:
|
||||||
|
@ -16,8 +16,8 @@ logfile=/home/inventree/log/supervisor.log
|
|||||||
|
|
||||||
[program:inventree-server]
|
[program:inventree-server]
|
||||||
user=inventree
|
user=inventree
|
||||||
directory=/mnt/c/inventree/InvenTree
|
directory=/home/inventree/src/InvenTree
|
||||||
command=/mnt/c/inventree/inventree-env/bin/gunicorn -c gunicorn.conf.py InvenTree.wsgi
|
command=/home/inventree/env/bin/gunicorn -c gunicorn.conf.py InvenTree.wsgi
|
||||||
startsecs=10
|
startsecs=10
|
||||||
autostart=true
|
autostart=true
|
||||||
autorestart=true
|
autorestart=true
|
||||||
@ -28,8 +28,8 @@ stdout_logfile=/home/inventree/log/server.out.log
|
|||||||
|
|
||||||
[program:inventree-cluster]
|
[program:inventree-cluster]
|
||||||
user=inventree
|
user=inventree
|
||||||
directory=/mnt/c/inventree/InvenTree
|
directory=/home/inventree/src/InvenTree
|
||||||
command=/mnt/c/inventree/inventree-env/bin/python manage.py qcluster
|
command=/home/inventree/env/bin/python manage.py qcluster
|
||||||
startsecs=10
|
startsecs=10
|
||||||
autostart=true
|
autostart=true
|
||||||
autorestart=true
|
autorestart=true
|
||||||
|
22
tasks.py
22
tasks.py
@ -231,28 +231,6 @@ def coverage(c):
|
|||||||
# Generate coverage report
|
# Generate coverage report
|
||||||
c.run('coverage html')
|
c.run('coverage html')
|
||||||
|
|
||||||
@task
|
|
||||||
def mysql(c):
|
|
||||||
"""
|
|
||||||
Install packages required for using InvenTree with a MySQL database.
|
|
||||||
"""
|
|
||||||
|
|
||||||
print('Installing packages required for MySQL')
|
|
||||||
|
|
||||||
c.run('sudo apt-get install mysql-server libmysqlclient-dev')
|
|
||||||
c.run('pip3 install mysqlclient')
|
|
||||||
|
|
||||||
@task
|
|
||||||
def postgresql(c):
|
|
||||||
"""
|
|
||||||
Install packages required for using InvenTree with a PostgreSQL database
|
|
||||||
"""
|
|
||||||
|
|
||||||
print("Installing packages required for PostgreSQL")
|
|
||||||
|
|
||||||
c.run('sudo apt-get install postgresql postgresql-contrib libpq-dev')
|
|
||||||
c.run('pip3 install psycopg2')
|
|
||||||
|
|
||||||
@task(help={'filename': "Output filename (default = 'data.json')"})
|
@task(help={'filename': "Output filename (default = 'data.json')"})
|
||||||
def export_records(c, filename='data.json'):
|
def export_records(c, filename='data.json'):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user