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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:52:28+00:00 2026-05-26T22:52:28+00:00

I have a legacy system that I’d like to extend with an application written

  • 0

I have a legacy system that I’d like to extend with an application written in Django. The system hosts hundreds of small websites on the same server. A Mysql server takes care of the data: each website has its own Mysql database, (name derived from the hostname) with identical table structure. The list of all sites (hostnames and database names) is managed in a table in a separate database.

I don’t need the Django user/session tables at all, or the Django admin module.

Is it possible to write Django code so that:

  1. each Mysql query gets a correct database name (ultimately based on the request’s Host header)
  2. I don’t have to hardcode the hostname list in eg. settings.py. When a website is added or renamed, everything “just works” (or maybe I can send a signal to reload the site list).
  • 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-26T22:52:29+00:00Added an answer on May 26, 2026 at 10:52 pm

    Django spports multi-db, that means, you can use more than one DB on a single project.

    Documentation is here.

    On the other hand, Your second need might not be possible in simple ways. Somehow, you must add a new DB description to settings.py file. There is one possible way o solve this, but it is not a good one in some ways…

    When you define a new web site (from an UI interface like a webpage), you can write a script to open settings.py and add your new db information to DATABASE schema and save it and reload your settings… But as i said, writing settings.py programatically is dangerous.

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

Sidebar

Related Questions

I have written java application that makes socket connections with a legacy system. How
I have some data files from a legacy system that I would like to
At my place of work we have a legacy document management system that for
We have a legacy system that is essentially a glorified telnet interface. We cannot
I currently have a legacy system that uses SPs exclusively for access to the
I have a legacy system that produces XML with timestamps similar to ISO 8601,
I have an XML document format from a legacy system that I have to
I have been tasked with making some edits to a legacy system that is
I have a really ugly legacy database system that I need to integrate with.
Sadly, I have a legacy PHP4 system that I continuously need to add features

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.