Tony Mack | 7130ac3 | 2013-03-22 21:58:00 -0400 | [diff] [blame] | 1 | #!/usr/bin/env python |
| 2 | import os |
| 3 | import sys |
| 4 | |
| 5 | if __name__ == "__main__": |
Matteo Scandolo | b3d2d0d | 2016-01-11 17:03:52 -0800 | [diff] [blame] | 6 | os.chdir('..') # <<<---This is what you want to add |
Scott Baker | 76a840e | 2015-02-11 21:38:09 -0800 | [diff] [blame] | 7 | os.environ.setdefault("DJANGO_SETTINGS_MODULE", "xos.settings") |
Tony Mack | 7130ac3 | 2013-03-22 21:58:00 -0400 | [diff] [blame] | 8 | |
| 9 | from django.core.management import execute_from_command_line |
| 10 | |
David K. Bainbridge | e88f565 | 2015-12-03 16:16:38 -0800 | [diff] [blame] | 11 | if "--makemigrations" in sys.argv: |
Scott Baker | 0d86f97 | 2016-01-14 09:27:28 -0800 | [diff] [blame] | 12 | os.system("/opt/xos/tools/xos-manage makemigrations") |
David K. Bainbridge | e88f565 | 2015-12-03 16:16:38 -0800 | [diff] [blame] | 13 | sys.argv.remove("--makemigrations") |
| 14 | |
Scott Baker | 79eaac2 | 2014-10-21 15:05:29 -0700 | [diff] [blame] | 15 | if "--nomodelpolicy" in sys.argv: |
Sapan Bhatia | 0c78a88 | 2016-01-14 14:19:32 -0500 | [diff] [blame] | 16 | import synchronizers.model_policy as model_policy |
Scott Baker | 79eaac2 | 2014-10-21 15:05:29 -0700 | [diff] [blame] | 17 | model_policy.EnableModelPolicy(False) |
| 18 | sys.argv.remove("--nomodelpolicy") |
| 19 | |
Scott Baker | fbe0cd7 | 2014-11-19 18:01:13 -0800 | [diff] [blame] | 20 | if "--noobserver" in sys.argv: |
Sapan Bhatia | 0c78a88 | 2016-01-14 14:19:32 -0500 | [diff] [blame] | 21 | import synchronizers.base as observer |
Scott Baker | fbe0cd7 | 2014-11-19 18:01:13 -0800 | [diff] [blame] | 22 | observer.EnableObserver(False) |
| 23 | sys.argv.remove("--noobserver") |
| 24 | |
Tony Mack | 7130ac3 | 2013-03-22 21:58:00 -0400 | [diff] [blame] | 25 | execute_from_command_line(sys.argv) |