반응형 pydantic2 개인 프로젝트 리뷰 - oath2 2 FASTAPI Pydantic pydantic module 의 정의 Data validation and settings management using Python type annotations. pydantic enforces type hints at runtime, and provides user friendly errors when data is invalid. Define how data should be in pure, canonical Python; validate it with pydantic. 내가 정의한 pydantic schema.py 파일 class UserBase(BaseModel): username: str class UserCreate(UserBase): hashed_passwor.. 2022. 11. 17. 개인프로젝트 리뷰 - oauth 1 WEB(FE) 에서 User Login / Register 를 위해 Backend API 서버를 호출하여 사용자 로그인 및 생성을 진행합니다. API 는 모두 FastAPI 를 통해 만들어 졌습니다. Folder 구조는 이미지와 같으며 Main = API 정의된 함수 Crud = Main 에서 사용하는 함수의 Sub Function Database = DB Connection 정보 Models = ORM 을 위한 정의 Schemas = pydantic 사용을 위한 정의 로 구분되어 있습니다. 우선 첫 번째로 Database 설정을 알아 보겠습니다. - 패키지 설치 pip install sqlalchemy - 코드 리뷰 from sqlalchemy import create_engine from sqlalc.. 2022. 10. 31. 이전 1 다음