2
0
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:
Oliver Walters
2020-08-21 21:24:02 +10:00
parent f5fd0fc5be
commit 592e87941d
2 changed files with 20 additions and 25 deletions

View File

@ -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')