mirror of
https://github.com/th3r00t/pyShelf.git
synced 2026-04-28 01:59:35 -04:00
Adjusted logging to avoid max recursion errors
This commit is contained in:
15
configure
vendored
15
configure
vendored
@@ -6,7 +6,6 @@ from pathlib import Path
|
||||
from django.core.management.utils import get_random_secret_key
|
||||
from src.backend.lib.pyShelf import Admin
|
||||
|
||||
|
||||
def load_config():
|
||||
with open('config.json',"r") as file:
|
||||
config = json.load(file)
|
||||
@@ -26,8 +25,20 @@ def set_secret(config=load_config()):
|
||||
write_config(config)
|
||||
print(config["SECRET"])
|
||||
else:
|
||||
print(config["SECRET"])
|
||||
print("Secret already set, skipping.")
|
||||
|
||||
def init_django_database():
|
||||
cmds = [
|
||||
'python manage.py makemigrations',
|
||||
'python manage.py makemigrations interface',
|
||||
'python manage.py migrate',
|
||||
'python manage.py migrate interface',
|
||||
]
|
||||
os.chdir("src")
|
||||
for cmd in cmds:
|
||||
os.system(cmd)
|
||||
os.chdir("../")
|
||||
|
||||
set_secret()
|
||||
init_django_database()
|
||||
Admin(Path.cwd()).createsuperuser()
|
||||
|
||||
Reference in New Issue
Block a user