Re: Architecture of multiple Sites

2016-04-05 Thread jorrit787
These are both interesting solutions. I will give them a try, thanks! On Tuesday, March 22, 2016 at 2:08:27 AM UTC+1, jorr...@gmail.com wrote: > > I'm wondering if I understand the Sites framework correctly... I'm > building a forum-like project which will initially be accessible from > mydomai

Re: Architecture of multiple Sites

2016-03-23 Thread dhall
We ran into this problem and decided to extend Django's CurrentSiteMiddleware to allow for the specification of a default site to use in the case when you cannot determine the current site from the host of the incoming request. Description of problem: https://groups.google.com/forum/#!topic/ed

Re: Architecture of multiple Sites

2016-03-23 Thread Sai Kiran
You can try something like below: class CustomSiteManager(CurrentSiteManager): def get_queryset(self): current_site = Site.objects.get_current() return super(CustomSiteManager, self).get_queryset().filter( **{self._get_field_name() + '__id': current_site.id}) We

Re: Architecture of multiple Sites

2016-03-22 Thread jorrit787
But if I don't set the SITE_ID in settings.py I can't use the CurrentSiteManager, correct? On Tuesday, March 22, 2016 at 1:33:39 PM UTC+1, Sai Kiran wrote: > > If you need to use single projects for more than domains, create an entry > in django_site model by giving domain as well as verbose na

Re: Architecture of multiple Sites

2016-03-22 Thread Sai Kiran
If you need to use single projects for more than domains, create an entry in django_site model by giving domain as well as verbose name. Don't give any SITE_ID in settings.py, instead of this you can use Site.objects.get_current() in your view and compare the domain names and change the header

Architecture of multiple Sites

2016-03-21 Thread jorrit787
I'm wondering if I understand the Sites framework correctly... I'm building a forum-like project which will initially be accessible from mydomain.com . The project contains several apps like posts, members, ads, etc. Eventually I would like to create myseconddomain.com, which would have unique p