I am trying to work with Sites
Model of Django.
I dont quite understand why SITE_ID
should be SITE_ID = 1
.
in the docs:
The ID, as an integer, of the current site in the django_site database table. This is used so that application data can hook into specific sites and a single database can manage content for multiple sites.
why 1
? what is the current site
? this is not clearly explained in the docs.
lets say, I have www.coolsite.com
and some other subdomains like www.wow.coolsite.com
and www.awesome.coolsite.com
I want to render different content depending on domain name.
my question is, or better, are:
- Do I have to add all those domains into
Sites
Table in DB? - if so, how should I set
SITE_ID
in settings? Do I have to set all ids likeSITE_ID = 1
,SITE_ID = 2
.. etc? - what does
current site
has to do withSITE_ID = 1
?
I am a bit confused here.
I thought, each Site (e.g. www.wow.coolsite.com
) should be a separate django project so that they can have their own settings.py? and in each of those settings.py's, I will set the id of that page from Sites table? but then there are many django projects which also doesnot make sense to me.
SITE_ID
. what if i have 3 sites? do i have to add all those 3 site ids into one single main settings.py? this doesnot make any sense to me right now :( – Maxima