Understanding django.db.utils.OperationalError

I was following along in Django For Professionals and I got the following error message. I checked the documentation and it lists the error as an exception but does not provide much detail. I checked stackoverflow but I have not been able to find answers.

Error Message:
django.db.utils.OperationalError: could not translate host name “db” to address: nodename nor servname provided, or not known

Traceback Error: Hastebin
Docker.yml file : Hastebin

After speaking with the django discord it seems that my indentation was incorrect. upon fixing the indentation and running docker build the changes corrected the dockerfile and now it works!

per nanorepublica:

When making changes to the docker-compose yaml file, be it additions, modifications etc, you will always have to run a docker compose command afterwards.