django_manage problem

12 views
Skip to first unread message

Tiglath

unread,
Jul 7, 2016, 1:28:23 AM7/7/16
to Ansible Project

I need to run python manage.py migrate in an activated virtualenv

I used the django_manage module specifying the virtual env but it gives the same error as when I run migrate without activating, at the command line.

Is there a way to activate the virtualenv prior to running migrate in ansible?   Otherwise this is one step I cannot automate.  This is the error:

fatal: [i5k]: FAILED! => {"changed": true, "cmd": "cd /home/vagrant/django-blast;\\ export PATH=/home/vagrant/django-blast/py2.7/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/vagrant/bin; python manage.py migrate", "delta": "0:00:00.020032", "end": "2016-07-07 05:21:35.367043", "failed": true, "rc": 1, "start": "2016-07-07 05:21:35.347011", "stderr": "/bin/sh:  export: command not found\nTraceback (most recent call last):\n  File \"manage.py\", line 8, in <module>\n    from django.core.management import execute_from_command_line\nImportError: No module named django.core.management", "stdout": "", "stdout_lines": [], "warnings": []}

Thanks
Reply all
Reply to author
Forward
0 new messages