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 8326079
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T00:39:03+00:00 2026-06-09T00:39:03+00:00

I have created a Django proyect with 20 sites (one different domain per site)

  • 0

I have created a Django proyect with 20 sites (one different domain per site) for 20 different countries. The sites share everything: codebase, database, urls, templates, etc.

The only thing they don’t share are small customizations (logo, background color of the CSS theme, language code, etc.) that I set in each of the site settings file (each site has one settings file, and all of these files import a global settings file with the common stuff). Right now, in order to run the sites in development mode I’ll do:

django-admin.py runserver 8000 --settings=config.site_settings.site1
django-admin.py runserver 8001 --settings=config.site_settings.site2
...
django-admin.py runserver 8020 --settings=config.site_settings.site20

I have a couple of questions:

  1. I’ve read that it is possible to create a virtual host for each site (domain) and pass it the site’s settings.py file. However, I am afraid this would create one Django instance per site. Am I right?
  2. Is there a more efficient way of doing the deployment? I’ve read about django-dynamicsites but I am not sure if it is the right way to go.
  3. If I decide to deploy using Heroku, it seems that Heroku expects only one settings file per app, so I would need to have 20 apps. Is there a solution for that?

Thanks!

  • 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-06-09T00:39:04+00:00Added an answer on June 9, 2026 at 12:39 am

    So, I recently did something similar, and found that the strategy below is the best option. I’m going to assume that you are familiar with git branching at this point, as well as Heroku remotes. If you aren’t, you should read this first: https://devcenter.heroku.com/articles/git#multiple-remotes-and-environments

    The main strategy I’m taking is to have a single codebase (a single Git repo) with:

    • A master branch that contains all your shared code: templates, views, URLs.
    • Many site branches, based on master, which contain all site-specific customizations: css, images, settings files (if they are vastly different).

    The way this works is like so:

    First, make sure you’re on the master branch.

    Second, create a new git branch for one of your domains, eg: git checkout -b somedomain.com.

    Third, customize your somedomain.com branch so that it looks the way you want.

    Next, deploy somedomain.com live to Heroku, by running heroku create somedomain.com --remote somedomain.com.

    Now, push your somedomain.com branch code to your new Heroku application: git push somedomain.com somedomain.com:master. This will deploy your code on Heroku.

    Now that you’ve got your somedomain.com branch deployed with its own Heroku application, you can do all normal Heroku stuff by adding --remote somedomain.com to your normal Heroku commands, eg:

    • heroku pg:info --remote somedomain.com
    • heroku addons:add memcache:5mb --remote somedomain.com
    • etc.

    So, now you’ve basically got two branches: a master branch, and a somedomain.com branch.

    Go back to your master branch, and make another new branch for your next domain: git checkout master; git checkout -b anotherdomain.com. Then customize it to your liking (css, site-specific stuff), and deploy the same way we did above.

    Now I’m sure you can see where this is going by now. We’ve got one git branch for each of our custom domains, and each domain has it’s own Heroku app. The benefit (obviously) is that each of these project customizations are based off the master branch, which means that you can easily make updates to all sites at once.

    Let’s say you update one of your views in your master branch–how can you deploy it to all your custom sites at once? Easily!

    Just run:

    • git checkout somedomain.com
    • git merge master
    • git push somedomain.com somedomain.com:master # deploy the changes

    And repeat for each of your domains. In my environment, I wrote a script that does this, but it’s easy enough to do manually if you’d like.

    Anyhow, hopefully that helps.

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

Sidebar

Related Questions

I have 5 sites, each on their own domain, running under one django project.
Currently I have created two symbolic links for Django in /Users/hobbes3/Sites/ . A ls
I am new to django. setup is ubuntu server. Have created a project, database,
I would like to deplay a django application/project, which i have created within Aptana.
So I have a django project I just created called 'coolprojectsite' the directory structure
I have created a web service in django and its hosted on a shared
So, I have created a django app here: http://fpaste.org/bkFf/ without using django-admin. I want
I have a django 1.4 project with 2 apps: RemoteStorage and WeShouldServer (that one
In one of the apps of my Django site I require a third-party module/library.
I have problem in connecting with Facebook backend of django-social-auth. I have created a

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.