Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Replicating same model for different deployed application.

40 views
Skip to first unread message

Subodh Nijsure

unread,
Dec 29, 2012, 9:57:36 PM12/29/12
to django...@googlegroups.com
Hi,

I have following situation where. My model consist of say table1, table2, table3. 

I am going to "host" similar data and associated web interface for multiple customers -( customer1, customer2, customer3.) they would access these application as http://hostname/customer1 http://hostname/customer2 etc.

When customer1 application is deployed I want tables customer1_table1, customer1_table2, customer1_table3 to be created. Same for customer2, 3 etc.

Right now I am thinking of having one "template" directory where all database names are referred to as replaceme_table1, replaceme_table2 etc.

When I actually deploy application for real customer say customer1 I am copying this template to directory customer1 and running sed to  change 'replaceme' with 'customer1' 

Is there a better, elegant way to do this in django where you have same  model that needs to be deployed as multiple django applications?

-Subodh

Thiago Luiz Silva

unread,
Dec 30, 2012, 4:34:36 AM12/30/12
to django...@googlegroups.com
Hello,

I guess that the most elegant way is to create a "detachable" app in one principal project and then you install it on the projects that will use that. After the installation you may run the migrations for each project so you don´t have to change files and keep track of changes.

We are developing a application with a scenario that may be similar: http://hostname1 and http://hostname2 runs the same app, but with different databases and using South to generate the migrations.

If you wanna use the same database and the same app on the same domain, you should use the same table for all data and use the customer as a filter. Your database may become a bit confusing after 5 clients with 3 or 4 tables each one.


[]´s
ThLuiz






--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Amirouche

unread,
Dec 30, 2012, 11:57:31 AM12/30/12
to django...@googlegroups.com
Héllo Subodh
If I understand this is a multitenant application or multitenancy for short, one django instance for several customer. They are several application that are labeled like that, I can't recommend any in particular since I don't use it them.

Regards,

Amirouche

Subodh Nijsure

unread,
Dec 30, 2012, 1:43:11 PM12/30/12
to django...@googlegroups.com

Exactly I was missing the django/web app terminology of multi-tenant app. 

I tried using https://github.com/phugoid/django-simple-multitenant and it seems to have issues. I will see if I can fix them with my limited knowledge of django.

Are there any good multi-tenants frameworks for django out there, any recommendations?

Regards,
-Subodh

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/_np6wETOfSwJ.

Amirouche

unread,
Jan 1, 2013, 8:14:16 AM1/1/13
to django...@googlegroups.com


On Sunday, December 30, 2012 7:43:11 PM UTC+1, Subodh Nijsure wrote:

Exactly I was missing the django/web app terminology of multi-tenant app. 

I think, it's a software terminology, it isn't particular to web or django, but I encountered only in web.
 

I tried using https://github.com/phugoid/django-simple-multitenant and it seems to have issues. I will see if I can fix them with my limited knowledge of django.

Are there any good multi-tenants frameworks for django out there, any recommendations?

There is also the django.contrib.site that can be helpful, you might also be interested in a search about «django subdomains».


Amirouche
Reply all
Reply to author
Forward
0 new messages