Index: django/core/handlers/base.py
===================================================================
--- django/core/handlers/base.py	(revision 16353)
+++ django/core/handlers/base.py	(working copy)
@@ -198,10 +198,6 @@
         if settings.DEBUG_PROPAGATE_EXCEPTIONS:
             raise
 
-        if settings.DEBUG:
-            from django.views import debug
-            return debug.technical_500_response(request, *exc_info)
-
         logger.error('Internal Server Error: %s' % request.path,
             exc_info=exc_info,
             extra={
@@ -210,6 +206,10 @@
             }
         )
 
+        if settings.DEBUG:
+            from django.views import debug
+            return debug.technical_500_response(request, *exc_info)
+        
         # If Http500 handler is not installed, re-raise last exception
         if resolver.urlconf_module is None:
             raise exc_info[1], None, exc_info[2]
Index: django/utils/log.py
===================================================================
--- django/utils/log.py	(revision 16353)
+++ django/utils/log.py	(working copy)
@@ -42,6 +42,9 @@
     request data will be provided in the email report.
     """
     def emit(self, record):
+        if settings.DEBUG:
+            return
+        
         try:
             request = record.request
             subject = '%s (%s IP): %s' % (
