I wanna ask how to make a "python manage.py shell" and add a "from myapp.model import Contact c = Contact.objects.all().count() print c". Is this possible in a batch file?
            Asked
            
        
        
            Active
            
        
            Viewed 1,271 times
        
    1 Answers
2
            Try something like:
echo "from myapp.model import Contact; c = Contact.objects.all().count(); print c" | python manage.py shell
        Community
        
- 1
 - 1
 
        Medhat Gayed
        
- 2,585
 - 20
 - 12
 
- 
                    i tried it,it just display the command prompt and then closed. – Nethan Mar 26 '14 at 02:02