Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>With stock Django you must have a unique <code>settings.py</code> for each site... because the SITE_ID is defined in <code>settings.py</code> and is the key for which site is handling this request.</p> <p>In other words, SITE_ID is global to your instance and therefore you need an instance for each site.</p> <p>You can have a common <code>urls.py</code> if you wish because there's nothing preventing you from using the same <code>ROOT_URLCONF</code> in all your site <code>settings.py</code> files... or you can have diffent one for each site. In this case you would want to include sub URLs to prevent repeating yourself for any common URLs.</p> <p>There are at least two methods you can try to serve from a single instance:</p> <ol> <li><p>Use apache + <a href="http://code.google.com/p/modwsgi/" rel="noreferrer">mod_wsgi</a> and use the <a href="http://code.google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGIApplicationGroup" rel="noreferrer">WSGIApplicationGroup</a> and/or <a href="http://code.google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGIProcessGroup" rel="noreferrer">WSGIProcessGroup</a> directives. I've never needed these before so can't be completely sure these will work the way you want, but regardless you can definitely use mod_wsgi in daemon mode to greatly improve your memory footprint.</p></li> <li><p>You can play with Django middleware to deny/allow URLs based on the request hostname (see <a href="http://docs.djangoproject.com/en/dev/ref/request-response/#django.http.HttpRequest.get_host" rel="noreferrer">HttpRequest.get_host()</a> in the Django docs). For that matter, even though it would be a slight performance hit, you can put a decorator on all your views that checks the incoming host.</p></li> </ol>
 

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