call_command('syncdb') in virtualenv failing: Error: No module named staticfiles

315 views
Skip to first unread message

Stodge

unread,
Apr 23, 2012, 8:26:55 AM4/23/12
to django...@googlegroups.com
I'm trying to port an existing app to Django 1.4 so I'm using virtualenv. ./manage.py syncdb works but my old script that calls syncdb and creates dummy data doesn't. My code:

os.environ["DJANGO_SETTINGS_MODULE"]="settings"
call_command('syncdb', interactive=False)

is giving:

Error: No module named staticfiles

I assume it's using Django installed in /usr/lib64/python instead of the virtualenv? Any ideas how to fix this? Thanks

Stodge

unread,
Apr 23, 2012, 8:39:43 AM4/23/12
to django...@googlegroups.com
Bah - I completely forgot that my gen.py script had this :

#!/usr/bin/python
Reply all
Reply to author
Forward
0 new messages