mirror of
https://github.com/fromchat-messenger/web.git
synced 2026-09-22 19:15:08 +03:00
23 lines
1.1 KiB
Python
23 lines
1.1 KiB
Python
try:
|
|
# Preferred when running from project root: `python -m backend.main` or similar.
|
|
from backend.services.main.constants import *
|
|
from backend.services.main.db import *
|
|
from backend.services.main.models import *
|
|
from backend.services.main.validation import *
|
|
from backend.services.main.utils import *
|
|
from backend.services.main.dependencies import *
|
|
from backend.services.main.main import *
|
|
except ModuleNotFoundError as exc:
|
|
# Only attempt the fallback when the missing module is the 'backend' package itself.
|
|
if exc.name and exc.name.startswith("backend"):
|
|
# Fallback when running with CWD=backend (e.g. `cd backend && uvicorn main:app`)
|
|
from services.main.constants import *
|
|
from services.main.db import *
|
|
from services.main.models import *
|
|
from services.main.validation import *
|
|
from services.main.utils import *
|
|
from services.main.dependencies import *
|
|
from services.main.main import *
|
|
else:
|
|
# Re-raise (likely a missing external dependency like sqlalchemy)
|
|
raise |