Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Allow old django version compatibility by using syncdb.

  • Loading branch information...
commit b52fccf51390273d6cbf13153626ae2a19ce0bd0 1 parent 88f5f8b
@mjtamlyn mjtamlyn authored
Showing with 6 additions and 2 deletions.
  1. +6 −2 djangobench/utils.py
View
8 djangobench/utils.py
@@ -58,8 +58,12 @@ def run_benchmark(benchmark, migrate=True, setup=None, trials=None, handle_argv=
django.setup()
if migrate:
from django.core.management import call_command
- call_command("migrate", run_syncdb=True, verbosity=0)
- call_command("loaddata", "initial_data", verbosity=0)
+ if django.VERSION < (1, 7):
+ call_command("syncdb", run_syncdb=True, verbosity=0)
+ else:
+ call_command("migrate", run_syncdb=True, verbosity=0)
+ if django.VERSION >= (1, 8):
+ call_command("loaddata", "initial_data", verbosity=0)
if setup:
setup()
Please sign in to comment.
Something went wrong with that request. Please try again.