Question

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)
Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top