开发者

django tools for pushing preinstalled data 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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜