- 在knowledge/apps.py的ready()方法中注册Celery任务 - 移除ops/__init__.py中的直接导入,避免循环依赖 - 简化tasks/__init__.py,使用延迟导入 - 解决"Apps aren't loaded yet"错误 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
13 lines
296 B
Python
13 lines
296 B
Python
# coding=utf-8
|
||
"""
|
||
@project: MaxKB
|
||
@Author:虎
|
||
@file: __init__.py.py
|
||
@date:2024/8/16 14:47
|
||
@desc:
|
||
"""
|
||
from .celery import app as celery_app
|
||
|
||
# 任务注册现在通过knowledge/apps.py的ready()方法处理
|
||
# 这样可以避免Django应用未准备好时的导入问题
|