E_bme
E_bme

Reputation: 89

Effectively communicating between two Django applications on two servers (Multitenancy)

I'm hoping to be pointed in the right direction as far as what tools to use while in the process of developing an application that runs on two servers per client.

[Main Server][Client db Server]

Each client has their own server which has a django application managing their respective data, in addition to serving as a simple front end.
The main application server has a more feature-rich front end, using the same models/db schemas. It should have full read/write access to the client's database server.
The final desired effect would be a typical SaaS type deal:

client1.djangoapp.com => Connects to mysql database @ client1_IP
client2.djangoapp.com => Connects to mysql database @ client2_IP
...

Thanks in advance!

Upvotes: 0

Views: 893

Answers (1)

keshaB
keshaB

Reputation: 26

You could use different settings files, let's say settings_client_1.py and settings_client_2.py, import common settings from a common settings.py file to keep it DRY. Then add respective database settings.

Do the same with wsgi files, create one for each settings. Say, wsgi_c1.py and wsgi_c2.py

Then, in your web server direct the requests for client1.djangoapp.com to wsgi_c1.py and client2.djangoapp.com to wsgi_c2.py

Upvotes: 1

Related Questions