title: Where do I store my django project code when using apache and mod_wsgi?
body: <p>I'm looking at what appears to be conflicting information on django's website.</p>
  
  <p>On this page:
  <a href="https://docs.djangoproject.com/en/1.7/intro/tutorial01/" rel="nofollow">https://docs.djangoproject.com/en/1.7/intro/tutorial01/</a></p>
  
  <p>It says:</p>
  
  <blockquote>
    <p>It’s not a good idea to put any of this Python code within your Web
    server’s document root, because it risks the possibility that people
    may be able to view your code over the Web. That’s not good for
    security.</p>
    
    <p>Put your code in some directory outside of the document root, such as
    /home/mycode.</p>
  </blockquote>
  
  <p>However, on this page:
  <a href="https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/modwsgi/" rel="nofollow">https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/modwsgi/</a>
  It says this is how Apache should be set up:</p>
  
  <pre><code>WSGIScriptAlias / /path/to/mysite.com/mysite/wsgi.py
  WSGIPythonPath /path/to/mysite.com
  
  &lt;Directory /path/to/mysite.com/mysite&gt;
  &lt;Files wsgi.py&gt;
  Require all granted
  &lt;/Files&gt;
  &lt;/Directory&gt;
  </code></pre>
  
  <p>Doesn't the latter show the project files in the www root?</p>
  
  <p>So which is correct? The former or the latter?</p>
  
  <p>I have used these linux commands to set up the project:</p>
  
  <pre><code>cd /home/personal/network/django
  django-admin.py startproject djnet
  </code></pre>
  
  <p>I then put this into httpd.conf:</p>
  
  <pre><code>WSGIScriptAlias / /home/personal/network/django/djnet/wsgi.py
  WSGIPythonPath /home/personal/network/django
  &lt;Directory /home/personal/network/django/djnet&gt;
  &lt;Files wsgi.py&gt;
  Require all granted
  &lt;/Files&gt;
  &lt;/Directory&gt;
  </code></pre>
  
  <p>This works, but I'm worried about the "That’s not good for security" line in the first page I've referenced.</p>
  
  <p>Am I supposed to put the project code generated by <code>django-admin startproject</code> in a directory separate from the Apache directory? If so, how would I configure Apache?</p>