Closed istib closed 10 years ago
The arguments are separated from the command. Can you try:
(prodigy-define-service
:name "server"
:command "source"
:args '("~/.virtualenvs/myenv/bin/activate" "&&" "python" "manage.py" "runserver")
:cwd "~/myapp/"
:path '("~/.virtualenvs/myenv/bin/"))
Thanks for that. The problem seems to be that the process caller doesn't recognize the shell built-in command 'source'. Here's the output from your version: "apply: Searching for program: no such file or directory, source"
Try using bash -c
. For example instead of:
$ source foo.sh
Use:
$ bash -c 'source foo.sh'
Thank you. I didn't get it to work with combination of "bash -c", but using virtualenvwrapper.el to activate the environment does the trick:
(prodigy-define-service
:name "runserver"
:command "python"
:args '("manage.py" "runserver")
:cwd "path/to/server"
:kill-signal 'sigkill
:kill-process-buffer-on-stop t
:init (lambda () (venv-workon "virtualenv/name")))
Glad it worked out for you!
virtualenvs for python apps are activated using the following bash syntax: source ~/.virtualenvs/[ENV]/bin/activate
because the script cannot be an actual bash file. Trying this as prodigy process fails however:
(prodigy-define-service :name "server" :command "source ~/.virtualenvs/myenv/bin/activate && python manage.py runserver" :cwd "~/myapp/" :path '("~/.virtualenvs/myenv/bin/"))