Browse Source

django-py3: fix can't connect db.

INADA Naoki 11 years ago
parent
commit
d839b148e4
1 changed files with 4 additions and 1 deletions
  1. 4 1
      django/setup_py3.py

+ 4 - 1
django/setup_py3.py

@@ -14,6 +14,8 @@ def start(args, logfile, errfile):
     global proc
     setup_util.replace_text("django/hello/hello/settings.py", "HOST': '.*'", "HOST': '" + args.database_host + "'")
     setup_util.replace_text("django/hello/hello/settings.py", "\/home\/ubuntu",  home)
+    env = os.environ.copy()
+    env['DJANGO_DB'] = 'mysql'
     proc = subprocess.Popen([
         bin_dir + "/gunicorn",
         "hello.wsgi:application",
@@ -21,7 +23,8 @@ def start(args, logfile, errfile):
         "-b", "0.0.0.0:8080",
         '-w', str(NCPU*3),
         "--log-level=critical"],
-        cwd="django/hello", stderr=errfile, stdout=logfile)
+        cwd="django/hello",
+        env=env, stderr=errfile, stdout=logfile)
     return 0
 
 def stop(logfile, errfile):