mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-12 18:15:40 +00:00
Add more targets
- superuser - backup
This commit is contained in:
20
tasks.py
20
tasks.py
@ -100,6 +100,14 @@ def install(c):
|
||||
print("Config file 'config.yaml' does not exist - copying from template.")
|
||||
copyfile(CONFIG_TEMPLATE_FILE, CONFIG_FILE)
|
||||
|
||||
@task
|
||||
def superuser(c):
|
||||
"""
|
||||
Create a superuser (admin) account for the database.
|
||||
"""
|
||||
|
||||
manage(c, 'createsuperuser')
|
||||
|
||||
@task
|
||||
def migrate(c):
|
||||
"""
|
||||
@ -222,3 +230,15 @@ def postgresql(c):
|
||||
|
||||
c.run('sudo apt-get install postgresql postgresql-contrib libpq-dev')
|
||||
c.run('pip3 install psycopg2')
|
||||
|
||||
@task
|
||||
def backup(c):
|
||||
"""
|
||||
Create a backup of database models and uploaded media files.
|
||||
|
||||
Backup files will be written to the 'backup_dir' file specified in 'config.yaml'
|
||||
|
||||
"""
|
||||
|
||||
manage(c, 'dbbackup')
|
||||
manage(c, 'mediabackup')
|
||||
|
Reference in New Issue
Block a user