setup_py3.py 478 B

123456789101112131415161718
  1. import subprocess
  2. import time
  3. def start(args, logfile, errfile):
  4. subprocess.Popen(
  5. "$PY3_GUNICORN --pid=gunicorn.pid hello.wsgi:application -c gunicorn_conf.py --env DJANGO_DB=mysql",
  6. cwd="django", shell=True, stderr=errfile, stdout=logfile)
  7. time.sleep(3)
  8. return 0
  9. def stop(logfile, errfile):
  10. subprocess.call(
  11. "kill `cat gunicorn.pid`",
  12. cwd="django", shell=True, stderr=errfile, stdout=logfile)
  13. time.sleep(3)
  14. return 0