diff -r cf2ca8865912 django/middleware/doc.py
--- a/django/middleware/doc.py	Fri Jan 14 16:34:49 2011 +0100
+++ b/django/middleware/doc.py	Sat Jan 15 14:18:55 2011 +0100
@@ -12,6 +12,7 @@
         indicating the view function.  This is used by the documentation module
         to lookup the view function for an arbitrary page.
         """
+        assert hasattr(request, 'user'), "The XView middleware requires authentication middleware to be installed. Edit your MIDDLEWARE_CLASSES setting to insert 'django.contrib.auth.middleware.AuthenticationMiddleware'."
         if request.method == 'HEAD' and (request.META.get('REMOTE_ADDR') in settings.INTERNAL_IPS or
                                          (request.user.is_active and request.user.is_staff)):
             response = http.HttpResponse()
