Add ability to run lola-server with gunicorn

This commit is contained in:
Jeremy Dormitzer 2019-11-13 09:48:41 -05:00
parent 0f2d50a1fd
commit 288f54137c

View File

@ -3111,12 +3111,20 @@ Some functions to make my day job easier.
(direnv-update-directory-environment (eshell/pwd))
(pyvenv-workon venv)))
(defun lola-server ()
(interactive)
(defun lola-server (&optional no-gunicorn)
(interactive "P")
(with-venv "lola-server"
(with-default-directory "~/lola/lola-server"
(with-env-from-file "~/lola/lola-server/.env"
(run-service "lola-server" "python" "bin/start_web.py")))))
(if (not no-gunicorn)
(run-service "lola-server"
"gunicorn"
"-c"
"server/web/gunicorn.conf.py"
"-b"
"127.0.0.1:7200"
"bin.start_web:init_and_create_flask_app()")
(run-service "lola-server" "python" "bin/start_web.py"))))))
(defun lola-server-celery-worker ()
(interactive)