File: runshell.py

package info (click to toggle)
django-filter 2.1.0-1~bpo10%2B1
  • links: PTS, VCS
  • area: main
  • in suites: buster-backports
  • size: 1,384 kB
  • sloc: python: 7,216; makefile: 144
file content (19 lines) | stat: -rwxr-xr-x 501 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/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)

if __name__ == '__main__':
    runshell()