title: Django cannot import settings
body: <p>I'm trying to use django-admin dbshell (any other cmd gives the same result) on my project. And I got</p>
  
  <pre><code> You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.
  </code></pre>
  
  <p>So I did </p>
  
  <pre><code>export DJANGO_SETTINGS_MODULE=mysite.settings
  </code></pre>
  
  <p>and now I get</p>
  
  <pre><code>no module named 'mysite'
  </code></pre>
  
  <p>Of course I replace 'mysite' with the name of my app.
  Btw I already had this in my code:</p>
  
  <pre><code>if __name__ == "__main__":
      os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mysite.settings")
  </code></pre>
  
  <p>any idea?
  Thanks</p>