title: ImportError: Could not import settings... No module named settings?
body: <p>I'm working with Django 1.4 and Python 2.7.</p>
  
  <p>I've encountered this issue before, but was able to work around it by adding the parent directory to sys.path using this code:</p>
  
  <pre><code>import sys
  
  def rtrim(s, sep):
      return sep.join(s.split(sep)[0:-1])
  
  sys.path.insert(0, rtrim(sys.path[0], '/'))
  
  from django.core.management import setup_environ
  import settings
  
  setup_environ(settings)
  </code></pre>
  
  <p>Today, seemingly out of nowhere, it reared its ugly head once more. The directory structure is as follows:</p>
  
  <pre><code>Ingest/
    settings.py
    ingest/ (current working directory)
      test.py
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/fH2wq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fH2wq.png" alt="enter image description here"></a></p>
  
  <p>Here are sys.path and part of the Traceback:</p>
  
  <pre><code>['/mnt/c/Users/Travis/Documents/GitHub/{redacted}/Ingest', '/mnt/c/Users/Travis/Documents/GitHub/{redacted}/Ingest/ingest', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages']
  
  Traceback (most recent call last):
    File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 95, in __init__
      raise ImportError("Could not import settings '%s' (Is it on sys.path?): %s" % (self.SETTINGS_MODULE, e))
  ImportError: Could not import settings 'Ingest.settings' (Is it on sys.path?): No module named settings
  </code></pre>
  
  <p>As you can see, the parent directory is in sys.path.</p>