python 3.6 ~ python 3.8 Fastapi 0.95.0 Dependencies ⌾ What is "Dependency Injection" ⌵ 코드의 작동 및 사용에 필요한 의존성을 선언할 방법이 있음을 의미 ⌵ 반복적인 logic, DB connection 공유, 보안|인증|역할 요건 등에 유용하다 First Steps ⌾ Create a dependency or dependable & Import Depends ⌾ Declare the dependency, in the "dependant" Depends에는 single 파라미터만 지정하며 해당 파라미터는 함수와 유사하다 ... from fastapi import Depends, FastAPI async def common_paramete..
Python 3.6+ ~ Python 3.8 Fastapi 0.95.0 Intro ⌾ Run the code uvicorn main:app --reload --host 0.0.0.0 --port 8000 # main: the file main.py # app: the object created inside of main.py with the line app=FastAPI() Command line options Uvicorn An ASGI web server, for Python. Introduction Uvicorn is an ASGI web server implementation for Python. Until recently Python has lacked a minimal low-level ser..