开发者

django tools for pushing preinstalled data to database

开发者 https://www.devze.com 2022-12-14 15:08 出处:网络
It there a tool for django to install some static data (necessary data to have application runing ) to database?

It there a tool for django to install some static data (necessary data to have application runing ) to database?

./manage.py syncdb wi开发者_JAVA技巧ll make the database schema i db, some tool for pushing static data to db ?

Thanks


Fixtures.

EDIT: Better example.


Fill your database with static data you need, then execute command:

./manage.py dumpdata --indent=4 > initial_data.json

After that every ./manage.py syncdb will insert data that you entered the first time into database.

If you are familiar with json format (or xml or yaml) you can edit initial data by hand. For details check out official documentation.

0

精彩评论

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

关注公众号