Fix populate to work with Postgres

This commit is contained in:
Skia
2016-07-14 17:50:02 +02:00
parent e29e94711a
commit 67114f51e1
3 changed files with 13 additions and 8 deletions

View File

@ -13,10 +13,10 @@ class Command(BaseCommand):
def handle(self, *args, **options):
root_path = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
try:
os.unlink(os.path.join(root_path, 'db.sqlite3'))
os.mkdir(os.path.join(root_path)+'/data')
except Exception as e:
print(e)
call_command('flush')
call_command('migrate')
if options['prod']:
call_command('populate', '--prod')