Update
This commit is contained in:
parent
87c0d524c8
commit
9faa63ba8c
|
@ -3,8 +3,8 @@ import datetime
|
|||
import uuid
|
||||
from contextlib import asynccontextmanager
|
||||
|
||||
from fastapi import FastAPI, Request
|
||||
from fastapi.responses import HTMLResponse
|
||||
from fastapi import FastAPI, Request, HTTPException
|
||||
from fastapi.responses import HTMLResponse, JSONResponse
|
||||
from fastapi.staticfiles import StaticFiles
|
||||
from fastapi.templating import Jinja2Templates
|
||||
|
||||
|
@ -50,3 +50,8 @@ async def index(request: Request):
|
|||
key="sessionkey", value=str(uuid.uuid4()), expires=expires_t_str
|
||||
)
|
||||
return response
|
||||
|
||||
|
||||
@app.exception_handler(HTTPException)
|
||||
async def http_exception_handler(request, exc):
|
||||
return JSONResponse(status_code=exc.status_code, content={"detail": exc.detail})
|
||||
|
|
|
@ -1,18 +1,16 @@
|
|||
# from json import JSONDecodeError, dumps, loads
|
||||
|
||||
from fastapi import (
|
||||
APIRouter,
|
||||
Body,
|
||||
Cookie,
|
||||
Depends,
|
||||
FastAPI,
|
||||
Form,
|
||||
Header,
|
||||
HTTPException,
|
||||
Request,
|
||||
# Cookie,
|
||||
# Depends,
|
||||
# FastAPI,
|
||||
# Form,
|
||||
# Header,
|
||||
# HTTPException,
|
||||
# Request,
|
||||
)
|
||||
from fastapi.responses import HTMLResponse, JSONResponse
|
||||
from starlette.datastructures import FormData
|
||||
from fastapi.responses import JSONResponse
|
||||
|
||||
|
||||
from .repository import DatingRepository
|
||||
from .schemas import SDating, SDatingAdd, SDatingId
|
||||
|
|
Loading…
Reference in New Issue