title: django.db.utils.OperationalError: could not translate host name "db" to address: Name does not resolve
body: <p>my <strong>docker-compose.yml file</strong></p>
  <pre><code>version: &quot;3&quot;
  
  services:
    app:
      build:
        context: .
      ports:
        - &quot;8000:8000&quot;
      volumes:
        - ./app:/app
      command: &gt;
        sh -c &quot;python manage.py runserver 0.0.0.0:8000&quot;
      environment:
        - DB_HOST=db
        - DB_NAME=app
        - DB_USER=postgres
        - DB_PASS=supersecretpassword
      depends_on:
        - db
        
    db:
      image: postgres:13-alpine
      environment:
        - POSTGRES_DB=app
        - POSTGRES_USER=postgres 
  </code></pre>
  <p>my <strong>settings.py file</strong></p>
  <pre><code>DATABASES = {
         'default': {
          'ENGINE': 'django.db.backends.postgresql',
          'HOST': os.environ.get('DB_HOST'),
          'NAME': os.environ.get('DB_NAME'),
          'USER': os.environ.get('DB_USER'),
          'PASSWORD': os.environ.get('DB_PASS'),
      }
  </code></pre>
  <p>}</p>
  <p>when I run <strong>sudo docker-compose build</strong> it shows</p>
  <p><strong>django.db.utils.OperationalError: could not translate host name &quot;db&quot; to address: Name does not resolve</strong></p>
  <p>where I did mistake ?</p>