title: Python scripts can't load Django settings module -- ImportError
body: <p>I'm working on a Django project on Mac OS X in a virtual environment and have a few regular Python scripts that I need to run for some stuff (mostly manipulating data). However, every time I try to run one of these scripts that uses anything from Django, such as importing a model, fails wit this error:</p>
  
  <pre><code>ImportError: Could not import settings 'myproject.settings' (Is it on sys.path?): No module named myproject.settings
  </code></pre>
  
  <p>I've added the following lines to the top of the script:</p>
  
  <pre><code>import sys
  import os
  
  os.environ['DJANGO_SETTINGS_MODULE'] = 'myproject.settings'
  
  sys.path.append("path/to/project/")
  </code></pre>
  
  <p>I even print out the sys.path and I can see the path to the folder container myproject there. But still I get the same error. Any ideas on what I can do?</p>
  
  <hr>
  
  <p>When I run <code>python -m modulefinder my-script.py</code>, I get modules from my root Python path (the default is the Enthought distribution) and from my venv path. </p>