For this assignment I want you to go over the videos and I've created a X number of errors in the code that you will have to find and fix them. You should keep running the tests and read the error and try to understand what it mean. The purpose of this assignment is to get you accustomed to running the project and following the steps that the program uses to process requests.
Here is my repo with the working code: https://github.com/Woffee/fastapi_fall2024
You can get this repo working with the install instructions below. The assignment repo will not work because its filled with broken code.
To submit this assignment, you should make your own repository and add the remote to git and then push your fixed code to your own repo.
You will only get 100 if the entire QR program passes GitHub actions, so you will need to update the production.yml file to have your info and setup your environment variables on the repository.
-
Fork my repo on Github. Then clone YOUR new repo to your local machine:
git clone git@github.com:XXX/qr_code_api_broken_code.git(replace XXX to your github username). -
Make virtual environment:
python3 -m venv venv -
Activate virtual environment:
source venv/bin/activate -
Install requirements:
pip install -r requirements.txt -
IMPORTANT run:
mkdir qr_codesto create a qr codes directory to save in, permissions will be messed up and the docker container won't be able to write to the qr_codes directory if you don't. -
Note: make sure docker is started
-
run
pytestlocally to check that it works locally -
Start the app with
docker compose up --build -
Goto http://localhost/docs to view openapi spec documentation
-
Click "authorize" input username:
adminpassword:secret -
Test making, retrieving, and deleting QR codes on the spec page.