Index: django/db/models/query.py
===================================================================
--- django/db/models/query.py	(revision 13036)
+++ django/db/models/query.py	(working copy)
@@ -330,22 +330,23 @@
         Performs the query and returns a single object matching the given
         keyword arguments.
         """
         clone = self.filter(*args, **kwargs)
         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)
+            q = ', '.join([repr(a) for a in args] + ["%s=%r" % i for i in kwargs.items()])
+            raise self.model.DoesNotExist(u"%s matching query (`%s`) does not exist."
+                    % (self.model._meta.object_name, q))
         raise self.model.MultipleObjectsReturned("get() returned more than one %s -- it returned %s! Lookup parameters were %s"
                 % (self.model._meta.object_name, num, kwargs))
 
     def create(self, **kwargs):
         """
         Creates a new object with the given kwargs, saving it to the database
         and returning the created object.
         """
         obj = self.model(**kwargs)
         self._for_write = True
Index: django/contrib/sites/tests.py
===================================================================
--- django/contrib/sites/tests.py	(revision 13036)
+++ django/contrib/sites/tests.py	(working copy)
@@ -5,21 +5,21 @@
 
 # Make sure that get_current() does not return a deleted Site object.
 >>> s = Site.objects.get_current()
 >>> isinstance(s, Site)
 True
 
 >>> s.delete()
 >>> Site.objects.get_current()
 Traceback (most recent call last):
 ...
-DoesNotExist: Site matching query does not exist.
+DoesNotExist: Site matching query (`pk=1`) does not exist.
 
 # After updating a Site object (e.g. via the admin), we shouldn't return a
 # bogus value from the SITE_CACHE.
 >>> _ = Site.objects.create(id=settings.SITE_ID, domain="example.com", name="example.com")
 >>> site = Site.objects.get_current()
 >>> site.name
 u"example.com"
 >>> s2 = Site.objects.get(id=settings.SITE_ID)
 >>> s2.name = "Example site"
 >>> s2.save()
Index: tests/modeltests/custom_pk/models.py
===================================================================
--- tests/modeltests/custom_pk/models.py	(revision 13036)
+++ tests/modeltests/custom_pk/models.py	(working copy)
@@ -51,21 +51,21 @@
 >>> Employee.objects.all()
 [<Employee: Fran Bones>, <Employee: Dan Jones>]
 
 >>> Employee.objects.get(pk=123)
 <Employee: Dan Jones>
 >>> Employee.objects.get(pk=456)
 <Employee: Fran Bones>
 >>> Employee.objects.get(pk=42)
 Traceback (most recent call last):
     ...
-DoesNotExist: Employee matching query does not exist.
+DoesNotExist: Employee matching query (`pk=42`) does not exist.
 
 # Use the name of the primary key, rather than pk.
 >>> Employee.objects.get(employee_code__exact=123)
 <Employee: Dan Jones>
 
 # pk can be used as a substitute for the primary key.
 >>> Employee.objects.filter(pk__in=[123, 456])
 [<Employee: Fran Bones>, <Employee: Dan Jones>]
 
 # The primary key can be accessed via the pk property on the model.
Index: tests/modeltests/model_inheritance/models.py
===================================================================
--- tests/modeltests/model_inheritance/models.py	(revision 13036)
+++ tests/modeltests/model_inheritance/models.py	(working copy)
@@ -287,21 +287,21 @@
 >>> Place.objects.get(name='Ristorante Miron').restaurant.italianrestaurant
 <ItalianRestaurant: Ristorante Miron the italian restaurant>
 >>> Restaurant.objects.get(name='Ristorante Miron').italianrestaurant
 <ItalianRestaurant: Ristorante Miron the italian restaurant>
 
 # This won't work because the Demon Dogs restaurant is not an Italian
 # restaurant.
 >>> place.restaurant.italianrestaurant
 Traceback (most recent call last):
     ...
-DoesNotExist: ItalianRestaurant matching query does not exist.
+DoesNotExist: ItalianRestaurant matching query (`restaurant_ptr__pk=3`) does not exist.
 
 # An ItalianRestaurant which does not exist is also a Place which does not exist.
 >>> try:
 ...     ItalianRestaurant.objects.get(name='The Noodle Void')
 ... except Place.DoesNotExist:
 ...     pass
 
 # MultipleObjectsReturned is also inherited.
 >>> try:
 ...     Restaurant.objects.get(id__lt=10)
@@ -316,21 +316,21 @@
 >>> s2 = Supplier(name="Luigi's Pasta", address='456 Sesame St')
 >>> s2.save()
 >>> s2.customers = [ir]
 
 # This won't work because the Place we select is not a Restaurant (it's a
 # Supplier).
 >>> p = Place.objects.get(name="Joe's Chickens")
 >>> p.restaurant
 Traceback (most recent call last):
     ...
-DoesNotExist: Restaurant matching query does not exist.
+DoesNotExist: Restaurant matching query (`place_ptr__pk=5`) does not exist.
 
 # But we can descend from p to the Supplier child, as expected.
 >>> p.supplier
 <Supplier: Joe's Chickens the supplier>
 
 >>> ir.provider.order_by('-name')
 [<Supplier: Luigi's Pasta the supplier>, <Supplier: Joe's Chickens the supplier>]
 
 >>> Restaurant.objects.filter(provider__name__contains="Chickens")
 [<Restaurant: Ristorante Miron the restaurant>, <Restaurant: Demon Dogs the restaurant>]
Index: tests/modeltests/basic/models.py
===================================================================
--- tests/modeltests/basic/models.py	(revision 13036)
+++ tests/modeltests/basic/models.py	(working copy)
@@ -93,31 +93,31 @@
 >>> Article.objects.filter(pub_date__week_day=5)
 [<Article: Area woman programs in Python>]
 >>> Article.objects.filter(pub_date__week_day=6)
 []
 
 # Django raises an Article.DoesNotExist exception for get() if the parameters
 # don't match any object.
 >>> Article.objects.get(id__exact=2)
 Traceback (most recent call last):
     ...
-DoesNotExist: Article matching query does not exist.
+DoesNotExist: Article matching query (`id__exact=2`) does not exist.
 
 >>> Article.objects.get(pub_date__year=2005, pub_date__month=8)
 Traceback (most recent call last):
     ...
-DoesNotExist: Article matching query does not exist.
+DoesNotExist: Article matching query (`pub_date__year=2005, pub_date__month=8`) does not exist.
 
 >>> Article.objects.get(pub_date__week_day=6)
 Traceback (most recent call last):
     ...
-DoesNotExist: Article matching query does not exist.
+DoesNotExist: Article matching query (`pub_date__week_day=6`) does not exist.
 
 # Lookup by a primary key is the most common case, so Django provides a
 # shortcut for primary-key exact lookups.
 # The following is identical to articles.get(id=1).
 >>> Article.objects.get(pk=1)
 <Article: Area woman programs in Python>
 
 # pk can be used as a shortcut for the primary key name in any query
 >>> Article.objects.filter(pk__in=[1])
 [<Article: Area woman programs in Python>]
Index: tests/modeltests/one_to_one/models.py
===================================================================
--- tests/modeltests/one_to_one/models.py	(revision 13036)
+++ tests/modeltests/one_to_one/models.py	(working copy)
@@ -62,21 +62,21 @@
 <Place: Demon Dogs the place>
 
 # A Place can access its restaurant, if available.
 >>> p1.restaurant
 <Restaurant: Demon Dogs the restaurant>
 
 # p2 doesn't have an associated restaurant.
 >>> p2.restaurant
 Traceback (most recent call last):
     ...
-DoesNotExist: Restaurant matching query does not exist.
+DoesNotExist: Restaurant matching query (`place__pk=2`) does not exist.
 
 # Set the place using assignment notation. Because place is the primary key on
 # Restaurant, the save will create a new restaurant
 >>> r.place = p2
 >>> r.save()
 >>> p2.restaurant
 <Restaurant: Ace Hardware the restaurant>
 >>> r.place
 <Place: Ace Hardware the place>
 >>> p2.id
Index: tests/modeltests/get_latest/models.py
===================================================================
--- tests/modeltests/get_latest/models.py	(revision 13036)
+++ tests/modeltests/get_latest/models.py	(working copy)
@@ -27,21 +27,21 @@
     # Note that this model doesn't have "get_latest_by" set.
 
     def __unicode__(self):
         return self.name
 
 __test__ = {'API_TESTS':"""
 # Because no Articles exist yet, latest() raises ArticleDoesNotExist.
 >>> Article.objects.latest()
 Traceback (most recent call last):
     ...
-DoesNotExist: Article matching query does not exist.
+DoesNotExist: Article matching query (``) does not exist.
 
 # Create a couple of Articles.
 >>> from datetime import datetime
 >>> a1 = Article(headline='Article 1', pub_date=datetime(2005, 7, 26), expire_date=datetime(2005, 9, 1))
 >>> a1.save()
 >>> a2 = Article(headline='Article 2', pub_date=datetime(2005, 7, 27), expire_date=datetime(2005, 7, 28))
 >>> a2.save()
 >>> a3 = Article(headline='Article 3', pub_date=datetime(2005, 7, 27), expire_date=datetime(2005, 8, 27))
 >>> a3.save()
 >>> a4 = Article(headline='Article 4', pub_date=datetime(2005, 7, 28), expire_date=datetime(2005, 7, 30))
Index: tests/regressiontests/model_inheritance_regress/models.py
===================================================================
--- tests/regressiontests/model_inheritance_regress/models.py	(revision 13036)
+++ tests/regressiontests/model_inheritance_regress/models.py	(working copy)
@@ -239,26 +239,26 @@
 >>> Place.objects.get(pk=ident)
 <Place: Guido's All New House of Pasta the place>
 >>> xx = Restaurant.objects.create(name='a', address='xx', serves_hot_dogs=True, serves_pizza=False)
 
 # This should delete both Restuarants, plus the related places, plus the ItalianRestaurant.
 >>> Restaurant.objects.all().delete()
 
 >>> Place.objects.get(pk=ident)
 Traceback (most recent call last):
 ...
-DoesNotExist: Place matching query does not exist.
+DoesNotExist: Place matching query (`pk=1`) does not exist.
 
 >>> ItalianRestaurant.objects.get(pk=ident)
 Traceback (most recent call last):
 ...
-DoesNotExist: ItalianRestaurant matching query does not exist.
+DoesNotExist: ItalianRestaurant matching query (`pk=1`) does not exist.
 
 # Regression test for #6755
 >>> r = Restaurant(serves_pizza=False)
 >>> r.save()
 >>> r.id == r.place_ptr_id
 True
 >>> orig_id = r.id
 >>> r = Restaurant(place_ptr_id=orig_id, serves_pizza=True)
 >>> r.save()
 >>> r.id == orig_id
Index: tests/regressiontests/reverse_single_related/models.py
===================================================================
--- tests/regressiontests/reverse_single_related/models.py	(revision 13036)
+++ tests/regressiontests/reverse_single_related/models.py	(working copy)
@@ -42,13 +42,13 @@
 
 # If the manager is marked "use_for_related_fields", it'll get used instead
 # of the "bare" queryset. Usually you'd define this as a property on the class,
 # but this approximates that in a way that's easier in tests.
 
 >>> Source.objects.use_for_related_fields = True
 >>> private_item = Item.objects.get(pk=private_item.pk)
 >>> private_item.source
 Traceback (most recent call last):
     ...
-DoesNotExist: Source matching query does not exist.
+DoesNotExist: Source matching query (`id__exact=2`) does not exist.
 
 """}
