# How to make Django to have some predefined data model whenever someone run my django project from scratch.

**URL:** <https://forum.djangoproject.com/t/how-to-make-django-to-have-some-predefined-data-model-whenever-someone-run-my-django-project-from-scratch/17793>\
**Category:** Deployment\
**Created:** [December 23, 2022, 7:18pm UTC](https://forum.djangoproject.com/t/how-to-make-django-to-have-some-predefined-data-model-whenever-someone-run-my-django-project-from-scratch/17793 "2022-12-23T19:18:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ogdhruv](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/ogdhruv/32/10511_2.png) [@ogdhruv](https://forum.djangoproject.com/u/ogdhruv)\
**Post date:** [December 23, 2022, 7:18pm UTC](https://forum.djangoproject.com/t/how-to-make-django-to-have-some-predefined-data-model-whenever-someone-run-my-django-project-from-scratch/17793/1 "2022-12-23T19:18:46Z")

</div>

I am creating a book app, where I want my Django project to have 3 or 4 books information in the data model whenever someone runs my app from scratch when cloning the app from my GitHub repo.

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [December 23, 2022, 7:38pm UTC](https://forum.djangoproject.com/t/how-to-make-django-to-have-some-predefined-data-model-whenever-someone-run-my-django-project-from-scratch/17793/2 "2022-12-23T19:38:18Z")

</div>

Different ways to do this:

- Load everything in a sqlite database and include the database in your repo.

- Create a custom migration that loads data into the database

- Create fixtures that can be loaded using loaddata.

There are different benefits for each of these approaches. You might want to think about what you want the actual end result to look like from the user’s perspective.

---

<div class="post-metadata">

**Author:** ![plopidou](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/plopidou/32/5148_2.png) [@plopidou](https://forum.djangoproject.com/u/plopidou)\
**Post date:** [December 23, 2022, 7:38pm UTC](https://forum.djangoproject.com/t/how-to-make-django-to-have-some-predefined-data-model-whenever-someone-run-my-django-project-from-scratch/17793/3 "2022-12-23T19:38:55Z")

</div>

look up the following:

. dumpdata  
. loaddata  
. fixtures

for (non working) example:

```auto
from django.core.management import call_command
fixtures = [
    'book.json',
    'author.json'
]
for fixture in fixtures:
    call_command('loaddata', fixture)

```
