title: Deploying Django with WSGI: App Import Error
body: <p>I am new in apache, linux and python world. I am trying to deploy django application on apache using WSGI (the recommended way). </p>
  
  <h2>My django project directory structure is as follows...</h2>
  
  <ul>
  <li>/</li>
  <li>/apache/django.wsgi</li>
  <li>/apps/ #I put all my apps in this directory</li>
  <li>/apps/providers/</li>
  <li>/apps/shopping/</li>
  <li>/apps/...</li>
  <li>/middleware/</li>
  <li>...</li>
  </ul>
  
  <h2>In apache I have following settings....</h2>
  
  <pre><code>LoadModule wsgi_module modules/mod_wsgi.so
  WSGIScriptAlias / D:/Projects/project-name/apache/django.wsgi
  
  &lt;Directory "D:/Projects/project-name/apache/"&gt;
    Allow from all
    Order deny,allow
  &lt;/Directory&gt;
  </code></pre>
  
  <h2>django.wsgi file has got following code...</h2>
  
  <pre><code>import os
  import sys
  import settings
  
  sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/..')
  
  os.environ['DJANGO_SETTINGS_MODULE'] = 'project_name.settings'
  
  import django.core.handlers.wsgi
  
  application = django.core.handlers.wsgi.WSGIHandler()
  </code></pre>
  
  <p>On running I found this error in the appache's error.log...</p>
  
  <ul>
  <li>Error occured on this line. from apps.providers.models import Provider</li>
  <li>Import Error: No module named providers.models</li>
  </ul>
  
  <p><strong>I don't know why it is giving me this error. It should have loaded Provider from apps.providers.models but it is trying to load it from providers.model.</strong> </p>
  
  <p>Any solution will be appreciated.</p>
  
  <p>Thanks</p>