init_data.md 665 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
Loading initial/example data into the app
=====

To load some basic data in the app, you can use the python classes: `loadCountries`, `loadUniversities`, etc. available in `backend/backend_app/load_data/loading_scripts`.

You can load everything in one command by connecting to the `Django` shell:

```bash
make django_shell
```

12
And by running:
13
14

```python
15
from backend_app.load_data.load_all import load_all
16
17
18
19
20
21
22
load_all()
```

*NB: Those scripts are tested so they should work.*


By doing so, an admin user is created according to the environment variables `DJANGO_ADMIN_USERNAME` and `DJANGO_ADMIN_PASSWORD` that are set (in our case) in the `docker-compose` file.