Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Improved runserver to display 'CONTROL-C' vs. 'CTRL-BREAK' based on t…

…he current platform

git-svn-id: http://code.djangoproject.com/svn/django/trunk@2852 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 058ab898b0bd22ad6c9af106400a20fa9ee74b53 1 parent eb4bbbb
Adrian Holovaty adrianholovaty authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  django/core/management.py
3  django/core/management.py
View
@@ -970,13 +970,14 @@ def runserver(addr, port):
if not port.isdigit():
sys.stderr.write(style.ERROR("Error: %r is not a valid port number.\n" % port))
sys.exit(1)
+ quit_command = sys.platform == 'win32' and 'CTRL-BREAK' or 'CONTROL-C'
def inner_run():
from django.conf import settings
print "Validating models..."
validate()
print "\nDjango version %s, using settings %r" % (get_version(), settings.SETTINGS_MODULE)
print "Development server is running at http://%s:%s/" % (addr, port)
- print "Quit the server with CONTROL-C (Unix) or CTRL-BREAK (Windows)."
+ print "Quit the server with %s." % quit_command
try:
run(addr, int(port), AdminMediaHandler(WSGIHandler()))
except WSGIServerException, e:
Please sign in to comment.
Something went wrong with that request. Please try again.