On May 18, 2011, at 8:34 AM, Gabriel Gunderson wrote: > On Tue, May 17, 2011 at 11:53 AM, igalic <ivan.ga...@gmail.com> wrote: >> I went through the first part of the tutorial without problems, but >> when trying to turn on the admin app in tutorial 2, I got this error >> page with the message stated in subject line. >> >> Here's more info: >> >> Django: latest version from the trunk >> Python: 2.6.1 >> OS: OSX 10.6.7 >> >> Here's the info it gives me: >> >> DoesNotExist at /admin/ >> Site matching query does not exist. > > > It looks like it's related to the sites framework: > http://docs.djangoproject.com/en/dev/ref/contrib/sites/ > > I'd have a look at what's in my settings file for SITE_ID and take it > from there. > http://docs.djangoproject.com/en/dev/ref/settings/#std:setting-SITE_ID > > Let us know if you don't figure it out.
Thanks; unfortunately I haven't been able to move much further along. The SITE_ID setting is set to 1, which was automatically generated. My project doesn't reference it anywhere. The docs say the default is "not defined" so I tried deleting it, but then it gave me another error (complaining it wasn't defined). Setting it to 0 (a value I thought could be sensible) didn't work either. Checking the local variables in the exception stack trace, it seems the ID is passed properly (at the place where it crashes, in django/db/models/query.py in get the "pk" parameter is 1, which is set at one point below in the stack from "sid" (which I assume is site_id). The code that crashes is this: • if self.query.can_filter(): • clone = clone.order_by() • num = len(clone) • if num == 1: • return clone._result_cache[0] • if not num: • raise self.model.DoesNotExist("%s matching query does not exist." • % self.model._meta.object_name) ... • raise self.model.MultipleObjectsReturned("get() returned more than one %s -- it returned %s! Lookup parameters were %s" • % (self.model._meta.object_name, num, kwargs)) In this case, 'num' is nil, and self.model._meta.object_name is 'Site'. That's all I've been able to dig out; I'd appreciate any further help. I'm surprised I ran into this problem because I was just strictly following the tutorial, and I've basically just added some 10 lines of code to the project. I don't understand what could have gone wrong. Thanks, Ivan > > > Best, > Gabe > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.