SSH into Django Shell

Viewed 2659

I'm attempting to write a simple one-line script to ssh into a remote host, CD to my Django app's directory, and run manage.py shell. So far I have:

ssh -i mysite.pem root@remotehost "cd /usr/local/myapp; /bin/bash -i -c \"python manage.py shell;\""

This seems to work with the caveat that I can't see any output from my commands. All I see is:

Python 2.6.4 (r264:75706, Jun  4 2010, 18:20:16) 
[GCC 4.4.4 20100503 (Red Hat 4.4.4-2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)

And then any input I give, but when I press enter, I don't seem to see anything from stdout. However, if I enter syntactically invalid Python, I do see a Python traceback from stderr.

What else am I missing?

1 Answers
Related