Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Added shutdown_message to runserver command -- a hook for specifying …

…a message to display after the server is shut down

git-svn-id: http://code.djangoproject.com/svn/django/trunk@5911 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit a5400cf87321ec482185c11b9625dbc15c3f6f2f 1 parent 49c438f
Adrian Holovaty authored August 16, 2007
3  django/core/management/commands/runserver.py
@@ -31,6 +31,7 @@ def handle(self, addrport='', *args, **options):
31 31
 
32 32
         use_reloader = options.get('use_reloader', True)
33 33
         admin_media_dir = options.get('admin_media_dir', '')
  34
+        shutdown_message = options.get('shutdown_message', '')
34 35
         quit_command = (sys.platform == 'win32') and 'CTRL-BREAK' or 'CONTROL-C'
35 36
 
36 37
         def inner_run():
@@ -59,6 +60,8 @@ def inner_run():
59 60
                 # Need to use an OS exit because sys.exit doesn't work in a thread
60 61
                 os._exit(1)
61 62
             except KeyboardInterrupt:
  63
+                if shutdown_message:
  64
+                    print shutdown_message
62 65
                 sys.exit(0)
63 66
         if use_reloader:
64 67
             from django.utils import autoreload

0 notes on commit a5400cf

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