title: What does os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'folder.settings') do?
body: <p>I am taking an online Django class now, and I don't understand some of the configuration code. My instructor says that the following code is required in a Python code that populates my database.</p>
  <pre><code>import os
  os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'ProTwo.settings')
  
  import django
  django.setup()
  </code></pre>
  <p>I don't understand what this code is doing at all, except that the second argument in <code>setdefault()</code> is referring to my app's <code>settings.py</code> file.</p>
  <p>What is <code>DJANGO_SETTINGS_MODULE</code>? What does it do? Why is it passed in as an arg in <code>setdefault()</code>?</p>
  <p>And what does <code>django.setup()</code> do? What does it change?</p>