how to backup a django db
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a Django application that uses a Postgres database. I need to be able to backup and restore the db, both to ensure no data is lost and to be able to copy data from the production server to the development server during testing. There seem to be a few different ways to do this: Just interact with the db directly. So, for Postgres I might write a script using pg_dumpall and psql . Use the sqlclear / sqlall commands that come with Django. Use the dumpdata / loaddata commands that come with Django. So create new fixtures from the db you