@@ -530,6 +530,16 @@ def start(self):
530
530
},
531
531
_ ("Set debug level for the extension and underlying server applications." )
532
532
)
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
+
533
543
# Add notebook manager flags
534
544
flags .update (boolean_flag ('script' , 'FileContentsManager.save_script' ,
535
545
'DEPRECATED, IGNORED' ,
@@ -644,6 +654,10 @@ def _default_log_format(self):
644
654
help = _ ("Whether to allow the user to run the server as root." )
645
655
)
646
656
657
+ autoreload = Bool (False , config = True ,
658
+ help = ("Reload the webapp when changes are made to any Python src files." )
659
+ )
660
+
647
661
default_url = Unicode ('/' , config = True ,
648
662
help = _ ("The default URL to redirect to from `/`" )
649
663
)
@@ -1385,6 +1399,7 @@ def init_webapp(self):
1385
1399
if self .allow_origin_pat :
1386
1400
self .tornado_settings ['allow_origin_pat' ] = re .compile (self .allow_origin_pat )
1387
1401
self .tornado_settings ['allow_credentials' ] = self .allow_credentials
1402
+ self .tornado_settings ['autoreload' ] = self .autoreload
1388
1403
self .tornado_settings ['cookie_options' ] = self .cookie_options
1389
1404
self .tornado_settings ['get_secure_cookie_kwargs' ] = self .get_secure_cookie_kwargs
1390
1405
self .tornado_settings ['token' ] = self .token
0 commit comments