devwiki:litestar

This is an old revision of the document!


LiteStar install

  • python -m pip install litestar
  • once, done, you can run in the project dir, (where app.py is)
    litestar run
    • if error module missing, just pip install those
      • rich
      • click
      • uvicorn
      • jsbeautifier

Concepts

  • it provides a active server, allow other pc or program to communicate with it
  • it use url to point to each function of the app.py
    # (python decorator: a function repackage method, put below function as a component of decorator function)
    # so, the decoration function is like a white-label procedure function, need input function as lego part to output different behaved white-label funciton. 
    @get("/")
    async def func_a() -> str:
     
    # same
    func_a = get("/")(func_a)
  • devwiki/litestar.1692954679.txt.gz
  • Last modified: 2023/08/25 09:11
  • by ying