|
2 | 2 | from typing import Any |
3 | 3 | from urllib.parse import urlparse |
4 | 4 |
|
5 | | -import structlog |
6 | 5 | from asgi_correlation_id import CorrelationIdMiddleware |
7 | 6 | from asgi_correlation_id.context import correlation_id |
8 | 7 | from celery import Celery |
9 | | -from fastapi import FastAPI |
10 | | -from fastapi import Request |
11 | | -from fastapi import Response |
12 | | -from fastapi import status |
| 8 | +from fastapi import FastAPI, Request, Response, status |
13 | 9 | from fastapi.encoders import jsonable_encoder |
14 | 10 | from fastapi.exceptions import RequestValidationError |
15 | 11 | from fastapi.responses import JSONResponse |
16 | 12 | from starlette.middleware.cors import CORSMiddleware |
| 13 | +import structlog |
17 | 14 | from uvicorn.protocols.utils import get_path_with_query_string |
18 | 15 |
|
19 | | -from app.celery.celery_settings import get_celery_settings |
20 | 16 |
|
21 | 17 | # NOTE: Unconventional import order is needed to control boot up flow |
22 | 18 | # region Configuration |
23 | 19 | from app.core.config import settings |
| 20 | +from app.celery.celery_settings import get_celery_settings |
24 | 21 |
|
25 | 22 | celery_settings = get_celery_settings() |
26 | 23 |
|
@@ -144,21 +141,20 @@ async def validation_exception_handler( |
144 | 141 | ) |
145 | 142 |
|
146 | 143 |
|
147 | | -# from app.two_factor_authentication.api.router import ( |
148 | | -# api_router as two_factor_authentication_router, |
149 | | -# ) |
150 | | -# from app.auth.api.routers import api_router as auth_router |
151 | | -from app.common.api.routers import api_router as common_router |
152 | | - |
153 | 144 | # region Routers |
154 | 145 | # NOTE: its important to import routers last as this action |
155 | 146 | # triggers import of the use case layer all the way down |
156 | 147 | # to the model definitions. |
157 | 148 | from app.users.api.routers import api_router as users_router |
| 149 | +from app.two_factor_authentication.api.router import ( |
| 150 | + api_router as two_factor_authentication_router, |
| 151 | +) |
| 152 | +from app.auth.api.routers import api_router as auth_router |
| 153 | +from app.common.api.routers import api_router as common_router |
158 | 154 |
|
159 | 155 | app.include_router(users_router, prefix=settings.API_V1_STR) |
160 | | -# app.include_router(auth_router, prefix=settings.API_V1_STR) |
| 156 | +app.include_router(auth_router, prefix=settings.API_V1_STR) |
161 | 157 | app.include_router(common_router, prefix=settings.API_V1_STR) |
162 | | -# app.include_router( |
163 | | -# two_factor_authentication_router, prefix=settings.API_V1_STR |
164 | | -# ) |
| 158 | +app.include_router( |
| 159 | + two_factor_authentication_router, prefix=settings.API_V1_STR |
| 160 | +) |
0 commit comments