Ticket #4996: patch.diff
File patch.diff, 2.4 KB (added by , 17 years ago) |
---|
-
django/core/management.py
1202 1202 sys.stderr.write(s.read()) 1203 1203 sys.exit(1) 1204 1204 1205 def runserver(addr, port, use_reloader=True, admin_media_dir='' ):1205 def runserver(addr, port, use_reloader=True, admin_media_dir='', daemonize=False): 1206 1206 "Starts a lightweight Web server for development." 1207 1207 from django.core.servers.basehttp import run, AdminMediaHandler, WSGIServerException 1208 1208 from django.core.handlers.wsgi import WSGIHandler … … 1240 1240 os._exit(1) 1241 1241 except KeyboardInterrupt: 1242 1242 sys.exit(0) 1243 if daemonize: 1244 from django.utils.daemonize import become_daemon 1245 become_daemon() 1243 1246 if use_reloader: 1244 1247 from django.utils import autoreload 1245 1248 autoreload.main(inner_run) 1246 1249 else: 1247 1250 inner_run() 1248 runserver.args = '[-- noreload] [--adminmedia=ADMIN_MEDIA_PATH] [optional port number, or ipaddr:port]'1251 runserver.args = '[--daemonize] [--noreload] [--adminmedia=ADMIN_MEDIA_PATH] [optional port number, or ipaddr:port]' 1249 1252 1250 1253 def createcachetable(tablename): 1251 1254 "Creates the table needed to use the SQL cache backend" … … 1580 1583 help='Tells Django to NOT prompt the user for input of any kind.') 1581 1584 parser.add_option('--noreload', action='store_false', dest='use_reloader', default=True, 1582 1585 help='Tells Django to NOT use the auto-reloader when running the development server.') 1586 parser.add_option('--daemonize', action='store_true', dest='daemonize', default=False, 1587 help='Tells Django to NOT use the auto-reloader when running the development server.') 1583 1588 parser.add_option('--format', default='json', dest='format', 1584 1589 help='Specifies the output serialization format for fixtures') 1585 1590 parser.add_option('--indent', default=None, dest='indent', … … 1661 1666 addr, port = args[1].split(':') 1662 1667 except ValueError: 1663 1668 addr, port = '', args[1] 1664 action_mapping[action](addr, port, options.use_reloader, options.admin_media_path )1669 action_mapping[action](addr, port, options.use_reloader, options.admin_media_path, options.daemonize) 1665 1670 elif action == 'runfcgi': 1666 1671 action_mapping[action](args[1:]) 1667 1672 elif action == 'sqlinitialdata':