mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Merge pull request #9 from SchrodingersGat/master
Added installer script
This commit is contained in:
commit
ba10803117
34
install.py
Normal file
34
install.py
Normal file
@ -0,0 +1,34 @@
|
||||
from __future__ import print_function
|
||||
|
||||
import subprocess
|
||||
|
||||
def manage(*arg):
|
||||
args = ["python", "InvenTree/manage.py"]
|
||||
|
||||
for a in arg:
|
||||
args.append(a)
|
||||
|
||||
subprocess.call(args)
|
||||
|
||||
# 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
|
||||
manage("makemigrations", "part")
|
||||
manage("makemigrations", "stock")
|
||||
manage("makemigrations", "supplier")
|
||||
manage("makemigrations", "project")
|
||||
manage("makemigrations", "track")
|
||||
|
||||
# Update the database
|
||||
manage("migrate")
|
||||
|
||||
# Check for errors
|
||||
manage("check")
|
||||
|
||||
print("\n\nAdmin account:\nIf a superuser is not already installed,")
|
||||
print("run the command 'python InvenTree/manage.py createsuperuser'")
|
Loading…
Reference in New Issue
Block a user