Index: django/core/management/commands/runserver.py
===================================================================
--- django/core/management/commands/runserver.py	(revision 9917)
+++ django/core/management/commands/runserver.py	(working copy)
@@ -3,12 +3,30 @@
 import os
 import sys
 
+def load_wsgi_handler(dotted_path):
+    try:
+        dot = dotted_path.rindex('.')
+    except ValueError:
+        raise ValueError, "%r isn't a WSGI handler class" % dotted_path
+    handler_module, handler_classname = dotted_path[:dot], \
+                                        dotted_path[dot+1:]
+    __import__(handler_module, {}, {}, [])
+    mod = sys.modules[handler_module]
+    try:
+        return getattr(mod, handler_classname)
+    except AttributeError:
+        raise ValueError, 'Handler module "%s" does not define a "%s" \
+class' % (handler_module, handler_classname)
+
 class Command(BaseCommand):
     option_list = BaseCommand.option_list + (
         make_option('--noreload', action='store_false', dest='use_reloader', default=True,
             help='Tells Django to NOT use the auto-reloader.'),
         make_option('--adminmedia', dest='admin_media_path', default='',
             help='Specifies the directory from which to serve admin media.'),
+        make_option('--handler', dest='wsgihandler',
+                    default='django.core.handlers.wsgi.WSGIHandler',
+                    help='Specify an alterate WSGI handler class'),
     )
     help = "Starts a lightweight Web server for development."
     args = '[optional port number, or ipaddr:port]'
@@ -19,7 +37,7 @@
     def handle(self, addrport='', *args, **options):
         import django
         from django.core.servers.basehttp import run, AdminMediaHandler, WSGIServerException
-        from django.core.handlers.wsgi import WSGIHandler
+        WSGIHandler = load_wsgi_handler(options['wsgihandler'])
         if args:
             raise CommandError('Usage is runserver %s' % self.args)
         if not addrport:
Index: docs/ref/django-admin.txt
===================================================================
--- docs/ref/django-admin.txt	(revision 9917)
+++ docs/ref/django-admin.txt	(working copy)
@@ -502,6 +502,21 @@
 
     django-admin.py runserver --noreload
 
+--handler
+~~~~~~~~~
+
+Use the ``--handler`` option to specify an alternate WSGI handler class.
+This allows you to use the development server with a custom handler
+subclass instead of the default
+``django.core.handlers.wsgi.WSGIHandler``. Overriding the WSGI handler
+is useful in case you want to override any aspect of request handling,
+such as customizing 500 error handling. This option should be passed a
+dotted path to a ``WSGIHandler`` subclass.
+
+Example usage::
+
+    django-admin.py runserver --handler=wsgi.handler.WSGIHandler
+
 Examples of using different ports and addresses
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
