From d400995e9dc41b23051da8ee2699a517750a7d64 Mon Sep 17 00:00:00 2001 From: Skia Date: Sat, 7 Jan 2017 10:36:54 +0100 Subject: [PATCH] Update setup command to ease development --- core/management/commands/setup.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/core/management/commands/setup.py b/core/management/commands/setup.py index 6f4a3e13..6e42b1ff 100755 --- a/core/management/commands/setup.py +++ b/core/management/commands/setup.py @@ -14,9 +14,14 @@ class Command(BaseCommand): root_path = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(__file__)))) try: os.mkdir(os.path.join(root_path)+'/data') + print("Data dir created") except Exception as e: - print(e) - call_command('flush') + repr(e) + try: + os.remove(os.path.join(root_path, 'db.sqlite3')) + print("db.sqlite3 deleted") + except Exception as e: + repr(e) call_command('migrate') if options['prod']: call_command('populate', '--prod')