Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

django fabric syncdb

Tags:

django

fabric

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)
like image 619
bocca Avatar asked Feb 28 '23 12:02

bocca


1 Answers

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.

like image 73
David Winslow Avatar answered Mar 11 '23 11:03

David Winslow