[英]Django fixtures as a python script
Writing .json or .yaml for a lot of fixtures is tiresome (especially for Users password for example), just doing it in python with a nice for
loop is really nice and fast. 为许多装置编写.json或.yaml很麻烦(特别是对于用户密码),仅在python中使用一个不错的
for
循环来完成它确实非常好且快速。
But I can't find other people doing it like that. 但是我找不到其他人那样做。
Django具有用于从数据库准备夹具的内部命令: https : //docs.djangoproject.com/en/dev/ref/django-admin/#dumpdata-app-label-app-label-app-label-model
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.