title: Django Deployment on Apache's virtualhost
body: <p>I have a wordpress (<code>/var/www/cb</code>), which I wish to run as root (<code>www.cb.com</code>) and one Django app  (<code>/vc/cb/cb</code>) as a subdirectory (<code>cb.com/launch</code>).</p>
  
  <pre><code>&lt;IfModule mod_ssl.c&gt;
  &lt;VirtualHost _default_:443&gt;
          ServerAdmin info@cb.com
          ServerName cb.com
          DocumentRoot /var/www/cb
          &lt;Directory /&gt;
                  Options FollowSymLinks
                  AllowOverride None
          &lt;/Directory&gt;
          &lt;Directory /var/www/cb&gt;
                  Options Indexes FollowSymLinks MultiViews
                  AllowOverride FileInfo Indexes
                  Order allow,deny
                  allow from all
          &lt;/Directory&gt;
  
          WSGIScriptAlias /launch /vc/cb/cb/wsgi.py
          &lt;Directory "/vc/cb/cb"&gt;
          &lt;Files wsgi.py&gt;
                  Order deny,allow
                  Allow from all
          &lt;/Files&gt;
          &lt;/Directory&gt;
  &lt;/VirtualHost&gt;
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>A similar question has been asked <a href="https://stackoverflow.com/questions/3534678/django-wsgi-and-wordpress-coexisting-in-apache-virtualhost">here</a>, however that was pre-Django-1.4, where you had to create your wsgi file manually.</p>
  
  <p>In the documentation it says the wsgi.py is created automatically for you. The main difference I see is the file extension, in the link above they refer to the wsgi file as xx.wsgi while <a href="https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/modwsgi/#how-to-use-django-with-apache-and-mod-wsgi" rel="nofollow noreferrer">django 1.4 documentation</a> points to wsgi.py.  I don't know if this is an issue, but I get a 404 when I do a <code>https://cb.com/launch</code></p>
  
  <p><strong>The content of wsgi.py:</strong></p>
  
  <pre><code>import os
  import sys
  
  sys.path.append('/vc/cb')
  sys.path.append('/vc/cb/cb')
  
  os.environ.setdefault("DJANGO_SETTINGS_MODULE", "cb.settings")
  
  from django.core.wsgi import get_wsgi_application
  application = get_wsgi_application()
  </code></pre>
  
  <p>What am I missing? </p>