本文整理匯總了Python中django.utils.autoreload.main方法的典型用法代碼示例。如果您正苦於以下問題:Python autoreload.main方法的具體用法?Python autoreload.main怎麽用?Python autoreload.main使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類django.utils.autoreload
的用法示例。
在下文中一共展示了autoreload.main方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: handle
# 需要導入模塊: from django.utils import autoreload [as 別名]
# 或者: from django.utils.autoreload import main [as 別名]
def handle(self, *args, **options):
print('Starting celery worker with autoreload...')
autoreload.main(restart_celery)
示例2: handle
# 需要導入模塊: from django.utils import autoreload [as 別名]
# 或者: from django.utils.autoreload import main [as 別名]
def handle(self, *args, **options):
print('Starting celery worker with autoreload...')
try:
#autoreload.main(inner_run)
from django.utils.autoreload import run_with_reloader
run_with_reloader(restart_celery)
except ImportError:
from django.utils import autoreload
autoreload.main(restart_celery)
#autoreload.main(restart_celery)
示例3: run
# 需要導入模塊: from django.utils import autoreload [as 別名]
# 或者: from django.utils.autoreload import main [as 別名]
def run(self, **options):
"""
Runs the server, using the autoreloader if needed
"""
use_reloader = options.get('use_reloader')
if use_reloader:
autoreload.main(self.inner_run, None, options)
else:
self.inner_run(None, **options)
示例4: run
# 需要導入模塊: from django.utils import autoreload [as 別名]
# 或者: from django.utils.autoreload import main [as 別名]
def run(self, *args, **options):
"""
Runs the server, using the autoreloader if needed
"""
use_reloader = options.get('use_reloader')
if use_reloader:
autoreload.main(self.inner_run, args, options)
else:
self.inner_run(*args, **options)
示例5: handle
# 需要導入模塊: from django.utils import autoreload [as 別名]
# 或者: from django.utils.autoreload import main [as 別名]
def handle(self, *args, **options):
if options['autoreload'] is True:
self.stdout.write("ATTENTION! Autoreload is enabled!")
if hasattr(autoreload, "run_with_reloader"):
# Django 2.2. and above
autoreload.run_with_reloader(self._serve, **options)
else:
# Before Django 2.2.
autoreload.main(self._serve, None, options)
else:
self._serve(**options)