title: Django ImportError: Couldn't import Django When Use Docker
body: <p>I am getting an error in console while trying to use docker. How to fix it
  but when I test With  localhost it just work.</p>
  <p><a href="https://i.stack.imgur.com/uGuf2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uGuf2.png" alt="enter image description here" /></a></p>
  <p>error</p>
  <pre><code>PS C:\Users\Test\Desktop\Projects\Testadmin\master&gt; docker-compose up
  Creating network &quot;master_default&quot; with the default driver
  Creating master_web_1 ... done
  Attaching to master_web_1
  web_1  | Traceback (most recent call last):
  web_1  |   File &quot;manage.py&quot;, line 8, in &lt;module&gt;
  web_1  |     from django.core.management import execute_from_command_line
  web_1  | ModuleNotFoundError: No module named 'django'
  web_1  |
  web_1  | The above exception was the direct cause of the following exception:
  web_1  |
  web_1  | Traceback (most recent call last):
  web_1  |   File &quot;manage.py&quot;, line 10, in &lt;module&gt;
  web_1  |     raise ImportError(
  web_1  | ImportError: Couldn't import Django. Are you sure it's installed and available on your PYTHONPATH environment variable? Did you forget to activate a virtual environment?
  master_web_1 exited with code 1
  </code></pre>
  <p>docker-compose.yml</p>
  <pre><code>version: '3'
  
  services:
      web:
          build: .
          command: python manage.py runserver 0.0.0.0:8000
          volumes:
              - .:/app
          ports: 
              - &quot;8000:8000&quot;
              
  </code></pre>
  <p>Dockerfile</p>
  <pre><code>FROM python:3
  ENV PYTHONUNBUFFERED l
  RUN mkdir /app
  WORKDIR /app
  COPY requirements.txt /app/
  RUN pip install -r requirements.txt
  COPY . /app/
  </code></pre>
  <p>manage.py</p>
  <p>#!/usr/bin/env python
  import os
  import sys</p>
  <pre><code>if __name__ == '__main__':
      os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'master.settings')
      try:
          from django.core.management import execute_from_command_line
      except ImportError as exc:
          raise ImportError(
              &quot;Couldn't import Django. Are you sure it's installed and &quot;
              &quot;available on your PYTHONPATH environment variable? Did you &quot;
              &quot;forget to activate a virtual environment?&quot;
          ) from exc
      execute_from_command_line(sys.argv)
  </code></pre>
  <p>requirements.txt</p>
  <pre><code>Django==3.8.5
  </code></pre>