Uvicorn as the ASGI server you need to run your application.
A separate folder is used for this program:
- This README.md file.
- A web.py file which defines a backend web server using the FastAPI library.
- A client.py file which sends REST calls to the URL of the web server.
- A database holding the history of activity.
- The config.yml configuration file referenced by web.py and client.py.
- A GUI front-end web server to make changes to configurations.
Files above this folder (root at python-samples repo cloned from github.com):
- .gitignore folder
- .git folder
- README.md for all files in the repo,.
Files away from python-samples github:
- Binary image files at cloudinary.com
- Powerpoint files at
- Video files at youtube.com
Bring up server: https://localhost
React formatting
This file defines configuration settings, which can be changed by the GUI:
Configuration variables can be overridden at run-time by parmaters supplied when starting the program.
-
Server responses can be configured to exhibit anomalies to ensure that mechanisms at the client can really detect, report, and remediate issues:
- No response (for 404 error)
- delay to slow response
These conditions can be specified by changing the config file before runs, by specifying parameters at run time, or in real time in the GUI.
-
Client requests can be include forcing some anomalies identified by the server:
- Incorrect version
- No API specified
- Mispelled API
- API with no more access
- Port the web server uses.
- Creates the database if it doesn't exist.
- Shows its URL in stdout.
This was written with assist from several LLM models (Perpelexity, Google Gemini3, Warp.dev CLI)
- Tutorial at https://realpython.com/fastapi-python-web-apis/
- https://developers.google.com/gemini-code-assist/docs/use-agentic-chat-pair-programmer
This folder contains the code discussed in the tutorial How to Serve a Website With FastAPI Using HTML and Jinja2.
The recommended way to install FastAPI is with the [standard] extra dependencies. This ensures you get all the tools you need for developing an API without having to hunt down additional packages later:
$ python -m pip install "fastapi[standard]"The quotes around "fastapi[standard]" ensure the command works correctly across different terminals and operating systems. With the command above, you install several useful packages, including the FastAPI CLI and uvicorn, an ASGI server for running your application.
You can also use the requirements.txt file in this folder and run python -m pip install -r requirements.txt to install the standard dependencies of FastAPI.
