Create a .env file in the project folder. (For development, blank file is fine)
docker compose up./init.sh# Fix the full_name constraint
docker compose exec server python manage.py save_users_dummy
docker compose exec server python manage.py create_dummy_users
docker compose exec server python manage.py loadtestdata <case sensitive model_names> --count 2
# eg.
# docker compose exec server python manage.py loadtestdata Country --count 2
# docker compose exec server python manage.py loadtestdata Resource ResourceGroup --count 2And navigate to localhost:9000/graphiql to view available graphs.
Use localhost:9000/graphql to interact with the server from the client.
python manage.py split_geojsonpython manage.py graphql_schema --out schema.graphqlpython manage.py update_pre_2016_gidd_data.py old_conflict_data.csv old_disaster_data.csvpython manage.py update_idps_sadd_estimates idps_sadd_estimates.csvThis will create appropriate buckets with required policies based on the .env.
sh deploy/scripts/s3_bucket_setup.shpython manage.py addstatictoken -t 123456 "admin@idmcdb.org"There are custom management commands available to facilitate specific tasks.
./manage.py populate_calculation_logic_fieldNOTE: This command populates the
calculation_logicfield in the Figure Table if there is no existing data in it.
./manage.py update_ahhs_2024 update_ahhs.csvNOTE: This command populates the HouseholdSize Table and updates AHHS data in the Figure Table specifically for the year 2024.
./manage.py force_update_gidd_dataNOTE: This command forces an update of GIDD data. It's important to note that this command is intended for local development purposes only, so it should be used with caution.
Feel free to test in your style. Here, the test-docker-compose.yml doesn't persist data from test.
docker compose -f docker-compose.yml -f test-docker-compose.yml run --rm server pytest --reuse-db