title: how to make django render the default home page instead of apache
body: <p>As is known, after issuing a request with a sole IP or server name through web explorer, apache will return its default static home page to the explorer. I'm using django and apache with mod_wsgi to deploy my site(i.e. django app on apache web server). How to route the processing to django mapping rules defined in views.py to dynamically produce a home page(i.e. index page) for that site when I issue a request to that server running apache? Thanks in advance!</p>
  
  <p>I added the following configuration in the main Apache 'httpd.conf':</p>
  
  <pre><code>&lt;VirtualHost 127.0.0.1:80&gt;
  
      ServerName 127.0.0.1
      ServerAlias example.com
      ServerAdmin webmaster@example.com
  
      DocumentRoot /usr/local/www/documents
  
      Alias /robots.txt /usr/local/www/documents/robots.txt
      Alias /favicon.ico /usr/local/www/documents/favicon.ico
  
      Alias /media/ /usr/local/www/documents/media/
  
      &lt;Directory /usr/local/www/documents&gt;
      Require all granted
      &lt;/Directory&gt;
  
      WSGIDaemonProcess 127.0.0.1 processes=2 threads=15 display-name=%{GROUP}
      WSGIProcessGroup 127.0.0.1
  
      WSGIScriptAlias / /usr/local/www/wsgi-scripts/myapp.wsgi
  
      &lt;Directory /usr/local/www/wsgi-scripts&gt;
      Order allow,deny
      Allow from all
      &lt;/Directory&gt;
  
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>Code in myapp.wsgi:</p>
  
  <pre><code>def application(environ, start_response):
      status = '200 OK'
      output = b'Hello World!'
  
      response_headers = [('Content-type', 'text/plain'),
                          ('Content-Length', str(len(output)))]
      start_response(status, response_headers)
  
      return [output]
  </code></pre>
  
  <p>Then I issued 127.0.0.1, the explorer displayed 'It works!', which is the default page produced by apache, instead of which I wanted 'Hello world!' returned in this case. I just want that when just issued an IP or site address, the work of generating the default home page is directly delegated to django to dynamically handle rather than to return a static index.html by Apache. Although I configured <code>WSGIScriptAlias / /usr/local/www/wsgi-scripts/myapp.wsgi</code> , this seems still not work.</p>