# ❌ 不允许:
from config import settings
from core import xxx
from registrar.app import registrar_app因为它们依赖运行目录,脆弱。
# ✅ 统一写成:
from backend.config import settings
from backend.core.xxx import yyy
from backend.registrar.app.registrar_app import registrar_app这条规则无脑安全。
backend/registrar/app/
├── __init__.py
├── registrar_app.py
└── helpers.py