【发布时间】:2014-05-04 04:56:27
【问题描述】:
我想问如何制作一个“python manage.py shell”并添加一个“from myapp.model import Contact c = Contact.objects.all().count() print c”。这可能在批处理文件中吗?
【问题讨论】:
标签: python django django-shell
我想问如何制作一个“python manage.py shell”并添加一个“from myapp.model import Contact c = Contact.objects.all().count() print c”。这可能在批处理文件中吗?
【问题讨论】:
标签: python django django-shell
尝试类似:
echo "from myapp.model import Contact; c = Contact.objects.all().count(); print c" | python manage.py shell
【讨论】: