本文整理汇总了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)