Wanting to run multiple Django setting files under one fcgi instance
At the moment I'm running a Django application that is the same for all of my clients.
Each client has its own subdomain e.g.:
- http://clien开发者_高级运维t1.myapp.com/
- http://client2.myapp.com/
client1 has a settings file, client2 has a settings file etc. The Django app is the same for everyone.
Nginx proxies the requests for each subdomain to a fcgi instance.
So, every client runs its own Django instance, consuming a lot of memory.
Is it possible to run one fcgi instance that switches to the right settings file based on the subdomain that is requested?
Thank you very, very much for your time.
Good question. There was an extensive discussion of this exact problem on the django developers mailing list a few weeks ago.
Basically there isn't a good official solution right now but lots of people are solving the problem themselves in various ways. If you read the whole thread you will probably have a better idea of how to proceed or who to talk to.
精彩评论