Skip to content

Commit b52fccf

Browse files
committed
Allow old django version compatibility by using syncdb.
1 parent 88f5f8b commit b52fccf

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

djangobench/utils.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,12 @@ def run_benchmark(benchmark, migrate=True, setup=None, trials=None, handle_argv=
5858
django.setup()
5959
if migrate:
6060
from django.core.management import call_command
61-
call_command("migrate", run_syncdb=True, verbosity=0)
62-
call_command("loaddata", "initial_data", verbosity=0)
61+
if django.VERSION < (1, 7):
62+
call_command("syncdb", run_syncdb=True, verbosity=0)
63+
else:
64+
call_command("migrate", run_syncdb=True, verbosity=0)
65+
if django.VERSION >= (1, 8):
66+
call_command("loaddata", "initial_data", verbosity=0)
6367

6468
if setup:
6569
setup()

0 commit comments

Comments
 (0)