Skip to content

Commit

Permalink
Remove Django v1.9 support from runshell.py (carltongibson#1190)
Browse files Browse the repository at this point in the history
  • Loading branch information
smithdc1 authored Mar 20, 2020
1 parent 4c78f08 commit 9feb87c
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions runshell.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
#!/usr/bin/env python
import os
import sys
import django
from django.core.management import execute_from_command_line


def runshell():
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tests.settings")
execute_from_command_line(
sys.argv[:1] +
['migrate', '--noinput', '-v', '0'] +
(['--run-syncdb'] if django.VERSION >= (1, 9) else []))

argv = sys.argv[:1] + ['shell'] + sys.argv[1:]
execute_from_command_line(argv)
execute_from_command_line(sys.argv[:1] + ['migrate', '--noinput', '-v', '0'])
execute_from_command_line(sys.argv[:1] + ['shell'] + sys.argv[1:])

if __name__ == '__main__':
runshell()

0 comments on commit 9feb87c

Please sign in to comment.