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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T23:41:12+00:00 2026-05-20T23:41:12+00:00

I am planning to use Django for a multi-site project, where each site is

  • 0

I am planning to use Django for a multi-site project, where each site is mostly independent, but would share a few models across all the sites.

I am wondering if there is a way to make each Django ‘app’ it’s own site, complete with unique domain name, and still allow each site to access a common app that contains some models for user accounts, profiles, etc.

The plan is to allow single sign on to each site, sharing the account information via the common app, and creating cookies for each site once the user logs in.

I know Django has a ‘sites’ feature, but i’m not sure if this is robust enough for my needs.

Can anyone recommend a way to do this or point me towards any articles that might help?

UPDATE

Just wondering, would it be possible via apache, and possibly some modification to the urls.py to be able to point a certain domain to a url structure?

for example, lets say the main site is mainsite.com, and i want one of the other domains to point to mainsite.com/secondarysite where secondarysite is a django app within the same instance, and have apache mask the fact that the secondarysite.com domain is actually pointing to a different location?

  • 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-20T23:41:13+00:00Added an answer on May 20, 2026 at 11:41 pm

    Re. your update: You don’t need to fake the URL structure like that, unless you also want URLs like mainsite.com/secondarysite to be directly available to the user.

    I’ll assume you’re using name-based virtual hosting. One simple but very flexible approach would be to have each <VirtualHost> directive invoke a different wsgi script via the usual mod_wsgi configuration directives, and then each wsgi script can set os.environ['DJANGO_SETTINGS_MODULE'] pointing to a different settings file.

    Each of those settings files can have a different ROOT_URLCONF, so you can configure views at different paths if you need to. Leverage the include mechanism.

    If you want both domains to use the same database for everything, just have both settings files load the database config from a third file, eg. settings_shared.py. Or if you want to route some models to a shared database, and others not, that’s possible too. It’s easy to imagine how that could be configured for each domain:

    from settings_shared import DATABASES_SHARED
    DATABASES = DATABASES_SHARED.copy()
    DATABASES.update({ ... })
    

    This approach takes care of configuring URLs and databases for each domain.
    But it doesn’t take care of single sign-on.

    For the SSO portion, it really depends what sort of user experience you want and how much time you have 😉

    Try searching for “django sso”. There are a lot of relevant questions here, eg:
    Implementing Single Sign On (SSO) using Django,
    How to build a secure Django single signon between different sites?, Django + Google SSO openid, Integrating Django and .Net applications using Single Sign On (SSO), (Django) Sharing authentication across two sites that are on different domains

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

Sidebar

Related Questions

I am planning to use a Grid system for a site, but I'd like
I'm planning to use Django MPTT with a multi-tenant architecture, so there will be
We are planning to use Team Foundation Server, but we need to decide whether
I am planning to use SCTP for a embedded Linux project. Anybody has some
I am planning to use libcurl in my project. I had downloaded the library
I am planning to use PIC18F6*** serial microntroller for my project serial-ethernet converter. Once
I was planning to use db4o for a website. It's a microblog site with
We are planning to use the Scala in our upcoming project. We are all
I'm planning to use the Multiple apk approach to my current project, since it
In my Django site, I am planning on using message_set combined with some fancy

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.