Ticket #4996: patch.2.diff
File patch.2.diff, 2.6 KB (added by , 17 years ago) |
---|
-
docs/django-admin.txt
309 309 310 310 django-admin.py runserver --noreload 311 311 312 Run as daemon 313 ~~~~~~~~~~~~~~~~~~~~~~~ 314 If you wish to run the development server as a daemon, use the ``--daemonize`` option, like so:: 315 316 django-admin.py runserver --daemonize 317 312 318 shell 313 319 ----- 314 320 -
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" … … 1575 1578 help='Tells Django to NOT prompt the user for input of any kind.') 1576 1579 parser.add_option('--noreload', action='store_false', dest='use_reloader', default=True, 1577 1580 help='Tells Django to NOT use the auto-reloader when running the development server.') 1581 parser.add_option('--daemonize', action='store_true', dest='daemonize', default=False, 1582 help='Tells Django to daemonize the the development server.') 1578 1583 parser.add_option('--format', default='json', dest='format', 1579 1584 help='Specifies the output serialization format for fixtures') 1580 1585 parser.add_option('--indent', default=None, dest='indent', … … 1656 1661 addr, port = args[1].split(':') 1657 1662 except ValueError: 1658 1663 addr, port = '', args[1] 1659 action_mapping[action](addr, port, options.use_reloader, options.admin_media_path )1664 action_mapping[action](addr, port, options.use_reloader, options.admin_media_path, options.daemonize) 1660 1665 elif action == 'runfcgi': 1661 1666 action_mapping[action](args[1:]) 1662 1667 elif action == 'sqlinitialdata':