If you have some tables which are having same values everytime(staic values).
You can write your own [fixture][1] which define all values we are going to store into those tables.
You can create a directory of name fixtures into app folder.
Directory example :
|- my_app
| |- fixtures
| |- static_content.json
static_content.json can looks like
[
{
"model": "myapp.model1",
"pk": 1,
"fields": {
"first_name": "test",
"last_name": "Test_last"
}
},
{
"model": "myapp.model2",
"pk": 1,
"fields": {
"age": "21",
"email": "[email protected]"
}
}
]
before starting server by python manage.py runserver we can load our fixtures into our database by using below command.
python manage.py loaddata <fixturename>
Ex. python manage.py loaddata my_app/static_content.json
above command will work as a startup script for loading values into db tables.