I created a very simple project and app that just has one model. I
copied my settings.py file to a new file called settingsTwo.py and
changed the SITE_ID to 2. I then created a 2nd site in the Django
admin.
I created a simple view that returned settings.SITE_ID to be displayed
on the template.
I then ran the following 2 commands to start the servers.
django-admin.py runserver 127.0.0.1:8000 --settings=MySite.settings
django-admin.py runserver 127.0.0.1:8001 --settings=MySite.settingsTwo
No matter which url I go to, 127.0.0.1:8000 or 127.0.0.1:8001 the
settings.SITE_ID is "1". Even if I only start up the settingsTwo
server.
I thought this might be an issue with the dev server, so I set up Apach
+ mod_python and got the exact same results.
<VirtualHost *>
ServerName siteOne.localhost
SetHandler python-program
PythonHandler django.core.handlers.modpython
PythonPath "['/home/jay/workspace'] + sys.path"
SetEnv DJANGO_SETTINGS_MODULE MySite.settings
PythonDebug On
</VirtualHost>
<VirtualHost *>
ServerName siteTwo.localhost
SetHandler python-program
PythonHandler django.core.handlers.modpython
PythonPath "['/home/jay/workspace'] + sys.path"
SetEnv DJANGO_SETTINGS_MODULE MySite.settingsTwo
PythonDebug On
</VirtualHost>
I know I must be missing something but after reading
http://www.djangoproject.com/documentation/sites/ 3 times, I just can't
seem to figure out what.