mirror of
https://github.com/ae-utbm/sith.git
synced 2026-10-11 21:26:02 +00:00
Update setup command to ease development
This commit is contained in:
1 parent
70aaf0b1c6
commit
d400995e9d
1 file changed
+7
-2
@@ -14,9 +14,14 @@ class Command(BaseCommand):
|
|||||||
root_path = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
|
root_path = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
|
||||||
try:
|
try:
|
||||||
os.mkdir(os.path.join(root_path)+'/data')
|
os.mkdir(os.path.join(root_path)+'/data')
|
||||||
|
print("Data dir created")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(e)
|
repr(e)
|
||||||
call_command('flush')
|
try:
|
||||||
|
os.remove(os.path.join(root_path, 'db.sqlite3'))
|
||||||
|
print("db.sqlite3 deleted")
|
||||||
|
except Exception as e:
|
||||||
|
repr(e)
|
||||||
call_command('migrate')
|
call_command('migrate')
|
||||||
if options['prod']:
|
if options['prod']:
|
||||||
call_command('populate', '--prod')
|
call_command('populate', '--prod')
|
||||||
|
|||||||
Reference in new issue
Block a user