tags:

views:

279

answers:

1

How would you run this django command to syncdb with fabric automatically.

python manage.py syncdb  --settings="app.settings.test"

if tried to do run, it gets stuck at the "Do you want to create superuser account", can it passed as yes and login information with it.

run('python manage.py syncdb  --settings="app.settings.%s"' % name, pty=True)
+4  A: 

Add --noinput to the arguments to keep django-admin from prompting:

python manage.py syncdb --settings="app.settings.%s" --noinput

If you have specific credentials that you'd like to preload always, I suspect the simplest way to achieve that would be to create a data dump of the user database from a machine with (just!) the admin account loaded, and then to load that in after syncdb. Alternatively, you could simply leave out the admin account and add it later with manage.py createsuperuser when and if you need to have it.

David Winslow
Or you can create a fixture with that data: then syncdb will add that when it creates the tables.
Matthew Schinckel