To complement the above list of locations where Site.objects.get_current is still in use, I have generated the following list of locations in the code where settings.SITE_ID continues to be in use:
$ grep -nr SITE_ID * | grep -v svn | grep -v pyc conf/project_template/settings.py:39:SITE_ID = 1 contrib/admindocs/views.py:134: site_obj = Site.objects.get(pk=settings_mod.SITE_ID) contrib/admindocs/views.py:141: 'site_id': settings_mod.SITE_ID, contrib/admindocs/views.py:286: site_obj = Site.objects.get(pk=settings_mod.SITE_ID) contrib/admindocs/views.py:295: 'site_id': settings_mod.SITE_ID, contrib/comments/feeds.py:27: site__pk = settings.SITE_ID, contrib/comments/forms.py:155: site_id = settings.SITE_ID, contrib/comments/templatetags/comments.py:82: site__pk = settings.SITE_ID, contrib/comments/views/moderation.py:21: comment = get_object_or_404(comments.get_model(), pk=comment_id, site__pk=settings.SITE_ID) contrib/comments/views/moderation.py:47: comment = get_object_or_404(comments.get_model(), pk=comment_id, site__pk=settings.SITE_ID) contrib/comments/views/moderation.py:74: comment = get_object_or_404(comments.get_model(), pk=comment_id, site__pk=settings.SITE_ID) contrib/flatpages/templatetags/flatpages.py:22: flatpages = FlatPage.objects.filter(sites__id=settings.SITE_ID) contrib/flatpages/views.py:35: f = get_object_or_404(FlatPage, url__exact=url, sites__id__exact=settings.SITE_ID) contrib/gis/tests/__init__.py:106: # Saving original values of INSTALLED_APPS, ROOT_URLCONF, and SITE_ID. contrib/gis/tests/__init__.py:109: self.old_site_id = getattr(settings, 'SITE_ID', None) contrib/gis/tests/__init__.py:123: # SITE_ID needs to be set contrib/gis/tests/__init__.py:124: settings.SITE_ID = 1 contrib/gis/tests/__init__.py:135: settings.SITE_ID = self.old_site_id contrib/redirects/middleware.py:11: r = Redirect.objects.get(site__id__exact=settings.SITE_ID, old_path=path) contrib/redirects/middleware.py:17: r = Redirect.objects.get(site__id__exact=settings.SITE_ID, contrib/sitemaps/tests/basic.py:124: public.sites.add(settings.SITE_ID) contrib/sitemaps/tests/basic.py:131: private.sites.add(settings.SITE_ID) Binary file contrib/sites/.models.py.swp matches contrib/sites/models.py:26: Returns the current ``Site`` based on the SITE_ID in the contrib/sites/models.py:38: sid = settings.SITE_ID contrib/sites/models.py:42: "the SITE_ID setting. Create a site in your database and set " contrib/sites/models.py:43: "the SITE_ID setting to fix this error." contrib/sites/models.py:154: elif hasattr(settings, 'SITE_ID'): contrib/sites/models.py:155: return Site.objects.get_site_by_id(settings.SITE_ID) contrib/sites/tests.py:11: Site(id=settings.SITE_ID, domain="staticsite.com", name="staticsite.com").save() contrib/sites/tests.py:31: s2 = Site.objects.get(id=settings.SITE_ID) contrib/sites/tests.py:46: self.assertEqual(site.id, settings.SITE_ID) contrib/sites/tests.py:60: self.assertNotEqual(site.id, settings.SITE_ID) The reason that this list is pertinent is that it shows where the Django code is locked into a "static multitenancy" model. Unless this code is converted to use get_request_site, none of the above contrib apps will work with a "dynamic multitenancy" model. In a number of the above cases, a conversion will be trivial. However, in any case where the SITE_ID is referenced inside an object or function that is not a view, and therefore does not have reference to the incoming request, there may be a problem in eliminating the dependency. -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com. To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.