From 6e579ce2061757aab23e51f1a24ddeefdec1c13f Mon Sep 17 00:00:00 2001 From: Hans Ulrich Niedermann Date: Thu, 8 May 2008 16:54:47 +0200 Subject: [PATCH] Have runserver print traceback for server errors Printing a "nice" error message is nice, but it's the traceback which helps locate and fix a bug. --- django/core/management/commands/runserver.py | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/django/core/management/commands/runserver.py b/django/core/management/commands/runserver.py index 12808bc..7b0f1ca 100644 --- a/django/core/management/commands/runserver.py +++ b/django/core/management/commands/runserver.py @@ -42,6 +42,7 @@ class Command(BaseCommand): quit_command = (sys.platform == 'win32') and 'CTRL-BREAK' or 'CONTROL-C' def inner_run(): + import traceback from django.conf import settings print "Validating models..." self.validate(display_num_errors=True) @@ -59,6 +60,7 @@ class Command(BaseCommand): 98: "That port is already in use.", 99: "That IP address can't be assigned-to.", } + traceback.print_exc(None, sys.stderr) try: error_text = ERRORS[e.args[0].args[0]] except (AttributeError, KeyError): -- 1.5.5.1