Note that there are some explanatory texts on larger screens.

plurals
  1. PO"sites framework" on a single django instance
    primarykey
    data
    text
    <p>I want to serve up specialized RSS feeds on a different subdomain from the rest of the site.</p> <p>Can I use the sites framework to use a different urls.py and settings.py file <strong>within a single django instance</strong>. or do I need to set up two apache locations and just set the different settings.py files in the apache conf.</p> <p>The reason I need to set up two urls.py files is to avoid duplicate content. I don't want the main site to be available at rss.example.com and I don't want the specialized feeds to be accessible on example.com</p> <p>Serving them from a single django instance would be ideal because we're on shared hosting with limited memory, and it seems like such a waste to have an instance open that only serves up rss.</p> <p><strong>edit</strong>: I concluded that multiple instances with seperate urls.py files would be easiest for me... but I found this article describing how to do it using a single instance:</p> <p><a href="http://effbot.org/zone/django-multihost.htm" rel="noreferrer">http://effbot.org/zone/django-multihost.htm</a></p> <h1>Solution: <a href="https://bitbucket.org/jiaaro/django-tupperware/src/" rel="noreferrer">Django tupperware</a></h1> <p>I ended up writing a framework for running multiple copies of a site on a single django instance.</p> <p>The basic idea is to change out the <code>SITE_ID</code> setting on the fly for each request and load alternate settings from the database. It does this based on domain and uses <code>SITE_ID = 1</code> by default (when it can't find anything)</p> <p>All settings in the settings.py file act as defaults which are overridden by the settings stored in the database for the current site.</p> <p>It works pretty well :) and it's running in production at <a href="http://rootbuzz.com" rel="noreferrer">http://rootbuzz.com</a></p>
    singulars
    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.
 

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