title: .env variables not visible inside settings.py file of a Django project run with Docker
body: <p>I am playing with Docker (deliberately not using docker-compose for now).
  The problem is that my variable set in .env file is not visible to settings.py, resulting in <code>None</code> being rendered by <code>print(os.environ.get('TEST_VAR'))</code> in <code>settings.py</code>.
  The problem goes away if I define the <code>TEST_VAR</code> variable inside the Dockerfile.
  Anyone know what I am doing wrong?
  Here's how my Django project looks like:</p>
  <p>Project layout:</p>
  <pre><code>my_project
     my_project
         settings.py
         .env
     manage.py
     requirements.txt
     Dockerfile
  </code></pre>
  <p>Dockerfile:</p>
  <pre><code>FROM python:3
  ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
  
  
  RUN mkdir /app
  WORKDIR /app
  ADD . /app/
  
  RUN apt-get -y update
  RUN apt-get install -y --fix-missing \
      libaio1 \
      git \
      wget \
      curl \
      pkg-config \
      python3-dev \
      software-properties-common \
      zip \
      &amp;&amp; apt-get clean &amp;&amp; rm -rf /tmp/* /var/tmp/*
  
  
  RUN pip install --no-cache-dir -r requirements.txt
  
  EXPOSE 8000
  CMD [&quot;python&quot;, &quot;manage.py&quot;, &quot;runserver&quot;, &quot;0.0.0.0:8000&quot;]
  </code></pre>
  <p>.env</p>
  <pre><code>TEST_VAR='wow'
  </code></pre>
  <p>The commands I run:</p>
  <pre><code>docker build -t simple-project .
  docker run -it -p 8000:8000 simple-project
  </code></pre>
  <p>Note that .env is on the same level as settings.py, however I have tried to move it one level up where, say, manage.py is located.</p>