Install & run
CLICommands
pip install "fastapi[standard]"Install FastAPI with all extrasuvicorn main:app --reloadDev server with auto-reloaduvicorn main:app --workers 4Production with 4 workersfastapi dev main.pyNew CLI (FastAPI 0.111+)Commands to install and run, the route decorators, and the parameter types.
A one-page reference for the commands and signatures used throughout the course. Use it to recall a signature quickly once the lessons are familiar - the reasoning behind each line is in the lesson that covers it.
pip install "fastapi[standard]"Install FastAPI with all extrasuvicorn main:app --reloadDev server with auto-reloaduvicorn main:app --workers 4Production with 4 workersfastapi dev main.pyNew CLI (FastAPI 0.111+)@app.get("/path")GET request@app.post("/path", status_code=201)POST with custom status@app.put("/path/{id}")PUT (full replace)@app.patch("/path/{id}")PATCH (partial update)@app.delete("/path/{id}", status_code=204)DELETE@app.get("/", response_model=MySchema)Filter/validate response@app.get("/", deprecated=True)Mark as deprecated in docsPath(..., gt=0, description="...")Path param with validationQuery(None, alias="page-num")Optional query with aliasHeader(None)Read HTTP headerCookie(None)Read cookie valueFile(...) / UploadFileFile uploadForm(...)Form dataSign in to leave a comment. Your name and photo come from Google; nothing else is shared.
Loading comments...