Jerome Provensal
Jerome Provensal

Reputation: 1057

How to initialize django objects automatically for the first time?

This is my first django application and I looked all over the place to find an answer, to no avail.

I created my models and I know need to to initialize the values to one of the classes. I could do it using the admin page, one by one, but I want anyone using my application to be able to just load the application for the first time to have all the correct objects (and associated records in the database) to be created automatically.

Please help

Upvotes: 1

Views: 1986

Answers (1)

ytsejam
ytsejam

Reputation: 3439

If you want to populate database, see the documentation for initial data. You can use JSON, XML or YAML (with PyYAML installed). I think you are looking for this as your question is not that clear.

Upvotes: 1

Related Questions