I asked a question before on how to create a SaaS application using Django
Django and SaaS. How to use separate database for each Django site?
Now when a user creates a new instance for himself I simply create a new settings.py file for him, and create an apache configuration for his subdomain. Now when a user tries to access his instance he can only see his own database, so we have total separation of data.
Now there is a problem when trying to do background processes while having these separate databases. Background processes should be specific to each instance acting only on this instance data. ZTask daemon takes a settings file to start. The question is do I have to start a separate ztaskd process for each Django instance? or can I start ztaskd once for all instances?
ztaskdworks within a context of particular Django instance, so you cannot share one ZTask daemon for multiple Django instances.You should run
ztaskdfor each Django instance with it’s local settings. Basically start it usingRemember to have non-conflicting
ZTASKD_URLfor each instance. For localztaskdas suggested in an answer to your previous question is good idea.