# HG changeset patch
# Parent e3363b0ff1d2fe8ad742afbf197e3986793beb8c
diff --git a/django/core/management/commands/testserver.py b/django/core/management/commands/testserver.py
a
|
b
|
from optparse import make_option
|
4 | 4 | |
5 | 5 | class Command(BaseCommand): |
6 | 6 | option_list = BaseCommand.option_list + ( |
| 7 | make_option('--noinput', action='store_false', dest='interactive', default=True, |
| 8 | help='Tells Django to NOT prompt the user for input of any kind.'), |
7 | 9 | make_option('--addrport', action='store', dest='addrport', |
8 | 10 | type='string', default='', |
9 | 11 | help='port number or ipaddr:port to run the server on'), |
… |
… |
class Command(BaseCommand):
|
18 | 20 | from django.db import connection |
19 | 21 | |
20 | 22 | verbosity = int(options.get('verbosity', 1)) |
| 23 | interactive = options.get('interactive', True) |
21 | 24 | addrport = options.get('addrport') |
22 | 25 | |
23 | 26 | # Create a test database. |
24 | | db_name = connection.creation.create_test_db(verbosity=verbosity) |
| 27 | db_name = connection.creation.create_test_db(verbosity=verbosity, autoclobber=not interactive) |
25 | 28 | |
26 | 29 | # Import the fixture data into the test database. |
27 | 30 | call_command('loaddata', *fixture_labels, **{'verbosity': verbosity}) |
diff --git a/docs/ref/django-admin.txt b/docs/ref/django-admin.txt
a
|
b
|
To run on 1.2.3.4:7000 with a ``test`` f
|
889 | 889 | |
890 | 890 | django-admin.py testserver --addrport 1.2.3.4:7000 test |
891 | 891 | |
| 892 | .. versionadded:: development |
| 893 | |
| 894 | The :djadminopt:`--noinput` option may be provided to suppress all user |
| 895 | prompts. |
| 896 | |
892 | 897 | validate |
893 | 898 | -------- |
894 | 899 | |