From 288f54137c41036fce3667a83f1d0b67fd771e77 Mon Sep 17 00:00:00 2001 From: Jeremy Dormitzer Date: Wed, 13 Nov 2019 09:48:41 -0500 Subject: [PATCH] Add ability to run lola-server with gunicorn --- emacs/init.org | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/emacs/init.org b/emacs/init.org index c6fd853..b5ce3a4 100755 --- a/emacs/init.org +++ b/emacs/init.org @@ -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)