summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Holovaty <adrian@holovaty.com>2007-08-16 22:48:32 +0000
committerAdrian Holovaty <adrian@holovaty.com>2007-08-16 22:48:32 +0000
commita5400cf87321ec482185c11b9625dbc15c3f6f2f (patch)
tree26a16f7eb02463efd47cd2454d574824ab0e3ffe
parent49c438fd219c8bc1ee1a32b98ef3777abeb289f6 (diff)
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
-rw-r--r--django/core/management/commands/runserver.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/django/core/management/commands/runserver.py b/django/core/management/commands/runserver.py
index d34a25f3e2..f089e80b16 100644
--- a/django/core/management/commands/runserver.py
+++ b/django/core/management/commands/runserver.py
@@ -31,6 +31,7 @@ class Command(BaseCommand):
use_reloader = options.get('use_reloader', True)
admin_media_dir = options.get('admin_media_dir', '')
+ shutdown_message = options.get('shutdown_message', '')
quit_command = (sys.platform == 'win32') and 'CTRL-BREAK' or 'CONTROL-C'
def inner_run():
@@ -59,6 +60,8 @@ class Command(BaseCommand):
# Need to use an OS exit because sys.exit doesn't work in a thread
os._exit(1)
except KeyboardInterrupt:
+ if shutdown_message:
+ print shutdown_message
sys.exit(0)
if use_reloader:
from django.utils import autoreload