mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-28 11:36:44 +00:00
Updated installer script
This commit is contained in:
parent
0a37291861
commit
774bd75e49
24
install.py
24
install.py
@ -1,6 +1,7 @@
|
|||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
|
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import argparse
|
||||||
|
|
||||||
def manage(*arg):
|
def manage(*arg):
|
||||||
args = ["python", "InvenTree/manage.py"]
|
args = ["python", "InvenTree/manage.py"]
|
||||||
@ -10,12 +11,20 @@ def manage(*arg):
|
|||||||
|
|
||||||
subprocess.call(args)
|
subprocess.call(args)
|
||||||
|
|
||||||
# Install django requirements
|
parser = argparse.ArgumentParser(description="Install InvenTree inventory management system")
|
||||||
subprocess.call(["pip", "install", "django", "-q"])
|
|
||||||
subprocess.call(["pip", "install", "djangorestframework", "-q"])
|
|
||||||
|
|
||||||
# Initial database setup
|
parser.add_argument('-u', '--update', help='Update only, do not try to install required components', action='store_true')
|
||||||
manage("migrate")
|
|
||||||
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
# If 'update' is specified, don't perform initial installation
|
||||||
|
if not args.update:
|
||||||
|
# Install django requirements
|
||||||
|
subprocess.call(["pip", "install", "django", "-q"])
|
||||||
|
subprocess.call(["pip", "install", "djangorestframework", "-q"])
|
||||||
|
|
||||||
|
# Initial database setup
|
||||||
|
manage("migrate")
|
||||||
|
|
||||||
# Make migrations for all apps
|
# Make migrations for all apps
|
||||||
manage("makemigrations", "part")
|
manage("makemigrations", "part")
|
||||||
@ -30,5 +39,6 @@ manage("migrate")
|
|||||||
# Check for errors
|
# Check for errors
|
||||||
manage("check")
|
manage("check")
|
||||||
|
|
||||||
print("\n\nAdmin account:\nIf a superuser is not already installed,")
|
if not args.update:
|
||||||
print("run the command 'python InvenTree/manage.py createsuperuser'")
|
print("\n\nAdmin account:\nIf a superuser is not already installed,")
|
||||||
|
print("run the command 'python InvenTree/manage.py createsuperuser'")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user