Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 249079
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T21:23:48+00:00 2026-05-11T21:23:48+00:00

I want to serve up specialized RSS feeds on a different subdomain from the

  • 0

I want to serve up specialized RSS feeds on a different subdomain from the rest of the site.

Can I use the sites framework to use a different urls.py and settings.py file within a single django instance. or do I need to set up two apache locations and just set the different settings.py files in the apache conf.

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

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.

edit: 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:

http://effbot.org/zone/django-multihost.htm

Solution: Django tupperware

I ended up writing a framework for running multiple copies of a site on a single django instance.

The basic idea is to change out the SITE_ID setting on the fly for each request and load alternate settings from the database. It does this based on domain and uses SITE_ID = 1 by default (when it can’t find anything)

All settings in the settings.py file act as defaults which are overridden by the settings stored in the database for the current site.

It works pretty well 🙂 and it’s running in production at http://rootbuzz.com

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T21:23:48+00:00Added an answer on May 11, 2026 at 9:23 pm

    With stock Django you must have a unique settings.py for each site… because the SITE_ID is defined in settings.py and is the key for which site is handling this request.

    In other words, SITE_ID is global to your instance and therefore you need an instance for each site.

    You can have a common urls.py if you wish because there’s nothing preventing you from using the same ROOT_URLCONF in all your site settings.py 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.

    There are at least two methods you can try to serve from a single instance:

    1. Use apache + mod_wsgi and use the WSGIApplicationGroup and/or WSGIProcessGroup 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.

    2. You can play with Django middleware to deny/allow URLs based on the request hostname (see HttpRequest.get_host() 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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to serve my css and images from a static cookieless domain. Now
I want so serve some videos on my site. They are available as .MP4
On my web site I want to serve user a page with a lot
I want spring to serve certain files from the /tmp... directory, the specific directory
I want to serve a mp4 video in a HTML document but it doesn't
Okay so I have an idea on how I want to serve and cache
Say I have a web service where I want to serve the content only
I have this code down here. When format.js fires I want to serve to
I run PHP 5.2 on Ubuntu with Apache 2. When I want to serve
I'm trying to cache Python/flask responses with memcached. I then want to serve the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.