Skip to content
Browse files

Improved 'django-admin runserver' so that it explicitly tells you how…

… to stop it. Also trapped KeyboardInterrupt so stopping it doesn't give an ugly traceback.

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 03c436b commit 304b08e3254f7c46999d1204ce9968c00ad088eb @adrianholovaty adrianholovaty committed
Showing with 3 additions and 0 deletions.
  1. +3 −0 django/core/
3 django/core/
@@ -425,6 +425,7 @@ def runserver(port):
print "Starting server on port %s with settings module %r." % (port, SETTINGS_MODULE)
print "Go to for Django." % port
+ print "Quit the server with CONTROL-C (Unix) or CTRL-BREAK (Windows)."
run(int(port), AdminMediaHandler(WSGIHandler()))
except WSGIServerException, e:
@@ -439,4 +440,6 @@ def runserver(port):
error_text = str(e)
sys.stderr.write("Error: %s\n" % error_text)
+ except KeyboardInterrupt:
+ sys.exit(0)
runserver.args = '[optional port number]'

0 comments on commit 304b08e

Please sign in to comment.
Something went wrong with that request. Please try again.