title: ImportError: No module named mysite.settings (Django)
body: <p>I have installed <a href="https://docs.djangoproject.com/en/1.9/topics/install/#installing-official-release" rel="noreferrer">Django</a> and <a href="https://pypi.python.org/pypi/mod_wsgi" rel="noreferrer">mod_wsgi-express</a> on an ubuntu 15.10. Basically (notice I did <strong>not</strong> do this as root):</p>
  
  <pre><code>pip install Django
  pip install mod_wsgi
  </code></pre>
  
  <p>Next I did:</p>
  
  <pre><code>~/.local/bin $ ./mod_wsgi-express start-server ~/mysite/mysite/wsgi.py
  </code></pre>
  
  <p>where: <code>~/mysite/mysite/wsgi.py</code> comes from the <a href="https://docs.djangoproject.com/en/1.9/intro/tutorial01/" rel="noreferrer">sample project</a> that I uploaded to the above destination on the server. But I get an error when I try to access the website (Internal Server Error). When I look in the log I see:</p>
  
  <pre><code>[Thu Mar 24 22:26:24.638043 2016] [wsgi:error] [pid 19469:tid 139785018738560]     mod = importlib.import_module(self.SETTINGS_MODULE)
  [Thu Mar 24 22:26:24.638070 2016] [wsgi:error] [pid 19469:tid 139785018738560]   File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
  [Thu Mar 24 22:26:24.781030 2016] [wsgi:error] [pid 19469:tid 139785018738560]     __import__(name)
  [Thu Mar 24 22:26:24.781148 2016] [wsgi:error] [pid 19469:tid 139785018738560] ImportError: No module named mysite.settings
  [Thu Mar 24 22:26:27.590300 2016] [wsgi:error] [pid 19469:tid 139784895194880] [remote 92.243.236.53:24636] mod_wsgi (pid=19469): Target WSGI script '/tmp/mod_wsgi-localhost:8000:1000/handler.wsgi' cannot be loaded as Python module.
  </code></pre>
  
  <p>So it seems that <strong>mysite.settings</strong> cannot be found/is not on the Python PATH (the file <strong>~/mysite/mysite/settings.py</strong> does exist).</p>
  
  <p>Based on:
  <a href="https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/" rel="noreferrer">https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/</a></p>
  
  <p>I tried to add:</p>
  
  <pre><code>os.environ["DJANGO_SETTINGS_MODULE"] = "mysite.settings" 
  </code></pre>
  
  <p>But it did not help. I also tried to add the above path to the sample project to the python path based on:
  <a href="https://code.djangoproject.com/wiki/PythonPath" rel="noreferrer">https://code.djangoproject.com/wiki/PythonPath</a></p>
  
  <p>But same error. What am I missing?</p>
  
  <p><strong>EDIT/Solution</strong>:</p>
  
  <p>The problem was in the include path:</p>
  
  <pre><code>import sys
  #Wrong!
  #sys.path.append("/home/user/mysite/mysite")
  
  #Correct
  sys.path.append("/home/user/mysite")
  </code></pre>