Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple sites with Django

Tags:

django

Let's imagine I have two sites foo.com and bar.com. They both are on the same server and now running separate Django instances and apache to serve it. Of course each Django instance eats the memory.

While mainly those sites are the same systems, but with different apps loaded - maybe it is possible somehow to have for example one Django instance running and have multiple sites using it? Then I will save memory for the one instance in a particular example.

It is possible to have different sites with their url.py files, loaded apps and so on? And if this is the right way to go?

Any tips, ideas are welcome.

Thanks, Ignas

like image 975
Ignas Butėnas Avatar asked Nov 30 '11 21:11

Ignas Butėnas


1 Answers

Yes it is definitely possible to have different sites with different urls.py and shared apps. I had to share a backend data between multiple sites. I just created 2 wsgi config files. And 2 settings files. The sites are very smiliar and didn't warrant two seperate projects. This allows me to use one django project and backend between multiple sites. I don't quite know if this is what you were asking though...

like image 173
dm03514 Avatar answered Oct 05 '22 23:10

dm03514