2014-03-26 94 views

回答

1

試着這麼做:

echo "from myapp.model import Contact; c = Contact.objects.all().count(); print c" | python manage.py shell 

或者這How do you read from stdin in Python?

+0

我試了一下,只顯示命令提示符,然後關閉。 – Nethan

+0

謝謝你。這真的幫助了我。謝謝。 – Nethan

相關問題