Django Fabric 同步数据库
您将如何运行此 django 命令来自动与 Fabric 同步数据库。
python manage.py syncdb --settings="app.settings.test"
如果尝试运行,它会卡在“是否要创建超级用户帐户”处,是否可以传递“是”并包含登录信息。
run('python manage.py syncdb --settings="app.settings.%s"' % name, pty=True)
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)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将
--noinput
添加到参数中以防止 django-admin 提示:如果您有想要始终预加载的特定凭据,我怀疑实现这一点的最简单方法是创建一个数据从加载了(仅!)管理员帐户的计算机上转储用户数据库,然后在syncdb之后加载该数据库。或者,您可以简单地省略管理员帐户,并在需要时使用
manage.py createsuperuser
添加它。Add
--noinput
to the arguments to keep django-admin from prompting: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.