def init_app(self, app):
"""
Initiate app, load all signal/callbacks files. (just import, they should register with decorators).
:param app: App instance
:type app: pyplanet.apps.AppConfig
"""
self._current_namespace = app.label
# Import the signals module.
try:
importlib.import_module('{}.signals'.format(app.name))
except ImportError:
pass
self._current_namespace = None
# Import the callbacks module.
try:
importlib.import_module('{}.callbacks'.format(app.name))
except ImportError:
pass
评论列表
文章目录