0👍
✅
Since ‘$ source’ was the thing that could not be executed. I made a shell script, placed it in a directory and just executed that
source pathto/pyenv/bin/activate && python manage.py dumpdata quiz > data_dump/foo.json
source pathto/pyenv/bin/activate && python manage.py dumpdata main > data_dump/bar.json
source pathto/pyenv/bin/activate && python manage.py dumpdata study > data_dump/waz.json
and then in the fabric file…
def foobar():
local('/pathto/foo.sh')
👤Joff
2👍
Your script executes under the classic sh shell, not under bash. “source” is a bash command; the classic import command is a period (like “. pathto/pyenv/bin/activate”). Or you could force bash with #!/bin/bash at the start of your script.
- [Answered ]-Django makemigrations does not work
- [Answered ]-Limit the Choices shown from ManyToMany ForeignKey
- [Answered ]-Django Rest Framework – Nested fields: Do not create but get one from existing records
- [Answered ]-Incremented CharField
- [Answered ]-Django models relation to two models before saving
Source:stackexchange.com