title: When working with a settings directory, where should I import it?
body: <p>I have recently started working with a settings directory as described in the <em>Two Scoops of Django</em> book. It contains the following files</p>
  <ul>
  <li><code>local.py</code></li>
  <li><code>staging.py</code></li>
  <li><code>production.py</code></li>
  <li><code>test.py</code></li>
  <li><code>__init__.py</code></li>
  </ul>
  <p>To be able to use the different setting files on the server I have adapted my django.fcgi script to import the settings module. It works very smoothly.</p>
  <p>How do I do the same on my local machine on which I use runserver, however? I have set the DJANGO_SETTINGS_MODULE and I have adapted the <code>manage.py</code> file to</p>
  <pre><code>#!/usr/bin/env python
  from django.core.management import execute_manager
  import imp
  
  import sys
  sys.path.insert(0, '/home/user/don.joey/projects/a_project/a_project_site/settings')
  
  import settings
  
  try:
      imp.find_module('settings') # Assumed to be in the same directory.
  except ImportError:
      import sys
      sys.stderr.write(&quot;Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n&quot; % __file__)
      sys.exit(1)
  
  if __name__ == &quot;__main__&quot;:
      execute_manager(settings)
  </code></pre>
  <p>It works fine.</p>
  <p><strong>How can I make <code>django-admin.py</code> find these settings?</strong> I do not want to manually edit django-admin.py because it is part of my virtualenv and it will does thus regularly be updated.</p>
  <h1>Update</h1>
  <p>I have set the following: <code>export DJANGO_SETTINGS_MODULE=settings.local</code>.</p>