开发者

django fabric syncdb

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 s开发者_开发技巧yncdb  --settings="app.settings.%s"' % name, pty=True)


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜