Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here's how I do it on my Mac, with Apache, Python and Django from Mac Ports. This is not necessarily the best approach but it works for me.</p> <p>I have the following top-level directories:</p> <ul> <li><code>lib</code>: python code, with settings.py in lib/settings.py</li> <li><code>static</code>: stuff to be served by Apache, e.g. media and CSS</li> <li><code>tools</code>: development tools, e.g. rollout scripts.</li> </ul> <p>So here's the Apache config for an example site, then see Django WSGI script below:</p> <pre><code>&lt;VirtualHost *:80&gt; # Stuff to served statically is in media directory DocumentRoot /Library/WebServer/mysite/static ServerName mysite.local # Redirect to homepage action RewriteEngine on RewriteRule ^/$ /mysite/ [R,L] # Static dirs first Alias /static/ /Library/WebServer/mysite/static/ &lt;Directory "/Library/WebServer/mysite/static/"&gt; Order allow,deny Allow from all &lt;/Directory&gt; # Now everything else goes to Django WSGIDaemonProcess mysite-django.local processes=1 threads=5 maximum-requests=0 display-name=%{GROUP} python-path=/Library/WebServer/mysite/lib python-eggs=/tmp WSGIProcessGroup mysite-django.local WSGIScriptAlias / /Library/WebServer/mysite/lib/apache/django_wsgi.py &lt;Directory "/Library/WebServer/mysite/lib/apache"&gt; Order allow,deny Allow from all &lt;/Directory&gt; &lt;/VirtualHost&gt; </code></pre> <p>The Django WGCI script is in lib/apache/django_wsgi.py:</p> <pre><code>import os import sys os.environ['DJANGO_SETTINGS_MODULE'] = 'settings' import django.core.handlers.wsgi application = django.core.handlers.wsgi.WSGIHandler() </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload