Changeset 6204
- Timestamp:
- 09/14/07 14:17:15 (1 year ago)
- Files:
-
- django/trunk/django/core/management/commands/testserver.py (modified) (3 diffs)
- django/trunk/docs/django-admin.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/core/management/commands/testserver.py
r6075 r6204 8 8 type='choice', choices=['0', '1', '2'], 9 9 help='Verbosity level; 0=minimal output, 1=normal output, 2=all output'), 10 make_option('--addrport', action='store', dest='addrport', 11 type='string', default='', 12 help='port number or ipaddr:port to run the server on'), 10 13 ) 11 14 help = 'Runs a development server with data from the given fixture(s).' … … 20 23 21 24 verbosity = int(options.get('verbosity', 1)) 25 addrport = options.get('addrport') 22 26 23 27 # Create a test database. … … 31 35 # multiple times. 32 36 shutdown_message = '\nServer stopped.\nNote that the test database, %r, has not been deleted. You can explore it on your own.' % db_name 33 call_command('runserver', shutdown_message=shutdown_message, use_reloader=False)37 call_command('runserver', addrport=addrport, shutdown_message=shutdown_message, use_reloader=False) django/trunk/docs/django-admin.txt
r6077 r6204 628 628 being made to a test database. 629 629 630 Note that this server can only run on the default port on localhost; it does 631 not yet accept a ``host`` or ``port`` parameter. 632 633 Also note that it does *not* automatically detect changes to your Python source 634 code (as ``runserver`` does). It does, however, detect changes to templates. 630 Note that this server does *not* automatically detect changes to your Python 631 source code (as ``runserver`` does). It does, however, detect changes to 632 templates. 635 633 636 634 .. _unit tests: ../testing/ 635 636 --addrport [port number or ipaddr:port] 637 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 638 639 Use ``--addrport`` to specify a different port, or IP address and port, from 640 the default of 127.0.0.1:8000. This value follows exactly the same format and 641 serves exactly the same function as the argument to the ``runserver`` subcommand. 642 643 Examples: 644 645 To run the test server on port 7000 with ``fixture1`` and ``fixture2``:: 646 647 django-admin.py testserver --addrport 7000 fixture1 fixture2 648 django-admin.py testserver fixture1 fixture2 --addrport 8080 649 650 (The above statements are equivalent. We include both of them to demonstrate 651 that it doesn't matter whether the options come before or after the 652 ``testserver`` command.) 653 654 To run on 1.2.3.4:7000 with a `test` fixture:: 655 656 django-admin.py testserver --addrport 1.2.3.4:7000 test 637 657 638 658 --verbosity
