title: in __getitem__ raise KeyError(key) from None
body: <p>I'm currently following a tutorial in which the database password is hidden/activated as a variable in the environment activate file. In the Django local_settings.py, the password is supposed to be retrieved like this:</p>
  
  <pre><code>"PASSWORD": os.environ['DATABASE_PW'],
  </code></pre>
  
  <p>However, this gives me the error:</p>
  
  <pre><code>  File "&lt;frozen importlib._bootstrap&gt;", line 1006, in _gcd_import
    File "&lt;frozen importlib._bootstrap&gt;", line 983, in _find_and_load
    File "&lt;frozen importlib._bootstrap&gt;", line 967, in _find_and_load_unlocked
    File "&lt;frozen importlib._bootstrap&gt;", line 677, in _load_unlocked
    File "&lt;frozen importlib._bootstrap_external&gt;", line 728, in exec_module
    File "&lt;frozen importlib._bootstrap&gt;", line 219, in _call_with_frames_removed
    File "C:\Users\User\Desktop\blog\project\project\settings.py"
  , line 325, in &lt;module&gt;
      exec(open(f, "rb").read())
    File "&lt;string&gt;", line 21, in &lt;module&gt;
    File "C:\Users\User\Envs\blog\lib\os.py", line 678, in __getitem__
      raise KeyError(key) from None
  KeyError: 'DATABASE_PW'
  </code></pre>
  
  <p>In the environment activate file, the password is saved as:</p>
  
  <pre><code>export DATABASE_PW = 'dbpass'
  </code></pre>
  
  <p>The server has not been running during setting the password, the error happens when I try to run python manage.py runserver.</p>
  
  <p>I have also deactivated and re-activated the environment before trying to run the server.</p>
  
  <p>What's missing to make it work?</p>