summaryrefslogtreecommitdiff
path: root/yaksh/scripts/cli.py
diff options
context:
space:
mode:
authoradityacp2017-01-04 11:40:59 +0530
committeradityacp2017-01-04 11:40:59 +0530
commitb271e3b33f673c70114893bf461d2a6116dd7cf7 (patch)
tree2eaca767ac94ede575bdc74be6dbea0a87fa4022 /yaksh/scripts/cli.py
parent48366e84b98157ac32b22b2aa19b1c1cde68afd4 (diff)
downloadonline_test-b271e3b33f673c70114893bf461d2a6116dd7cf7.tar.gz
online_test-b271e3b33f673c70114893bf461d2a6116dd7cf7.tar.bz2
online_test-b271e3b33f673c70114893bf461d2a6116dd7cf7.zip
Fix management commands
Diffstat (limited to 'yaksh/scripts/cli.py')
-rw-r--r--yaksh/scripts/cli.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/yaksh/scripts/cli.py b/yaksh/scripts/cli.py
index 79523f9..fa18ff7 100644
--- a/yaksh/scripts/cli.py
+++ b/yaksh/scripts/cli.py
@@ -1,5 +1,6 @@
from __future__ import print_function
+import django
import subprocess
import contextlib
import os
@@ -8,7 +9,7 @@ import argparse
from importlib import import_module
from django.conf import settings
from django.core import management
-from django.template import Template, Context, loader
+from django.template import Template, Context
from project_detail import NAME, PATH
@@ -17,6 +18,9 @@ SCRIPT_DIR = os.path.abspath(os.path.dirname(__file__))
PARENT_DIR = os.path.abspath(os.path.join(SCRIPT_DIR, os.pardir))
TEMPLATE_DIR = path.join(PARENT_DIR, 'demo_templates')
+settings.configure()
+django.setup()
+
def main():
#Parse command-line to obtain the arguments and/or options
# create top-level parser object
@@ -95,7 +99,7 @@ def create_demo(project_name='yaksh_demo', project_dir=CUR_DIR):
'fixture_dir': fixture_dir})
urls_template_path = path.join(TEMPLATE_DIR, 'demo_urls.py')
urls_target_path = path.join(project_path, 'demo_urls.py')
- command = ("python ../manage.py syncdb "
+ command = ("python ../manage.py migrate --run-syncdb "
"--noinput --settings={0}.demo_settings").format(project_name)
loaddata_command = ("python ../manage.py loaddata "