@@ -530,6 +530,16 @@ def start(self):
530530 },
531531 _ ("Set debug level for the extension and underlying server applications." )
532532)
533+ flags ['autoreload' ] = (
534+ {'ServerApp' : {'autoreload' : True }},
535+ """Autoreload the webapp
536+ Enable reloading of the tornado webapp and all imported Python packages
537+ when any changes are made to any Python src files in server or
538+ extensions.
539+ """
540+ )
541+
542+
533543# Add notebook manager flags
534544flags .update (boolean_flag ('script' , 'FileContentsManager.save_script' ,
535545 'DEPRECATED, IGNORED' ,
@@ -644,6 +654,10 @@ def _default_log_format(self):
644654 help = _ ("Whether to allow the user to run the server as root." )
645655 )
646656
657+ autoreload = Bool (False , config = True ,
658+ help = ("Reload the webapp when changes are made to any Python src files." )
659+ )
660+
647661 default_url = Unicode ('/' , config = True ,
648662 help = _ ("The default URL to redirect to from `/`" )
649663 )
@@ -1385,6 +1399,7 @@ def init_webapp(self):
13851399 if self .allow_origin_pat :
13861400 self .tornado_settings ['allow_origin_pat' ] = re .compile (self .allow_origin_pat )
13871401 self .tornado_settings ['allow_credentials' ] = self .allow_credentials
1402+ self .tornado_settings ['autoreload' ] = self .autoreload
13881403 self .tornado_settings ['cookie_options' ] = self .cookie_options
13891404 self .tornado_settings ['get_secure_cookie_kwargs' ] = self .get_secure_cookie_kwargs
13901405 self .tornado_settings ['token' ] = self .token
0 commit comments