Creating our FastAPI backend
I will now begin with the creation of the FastAPI-powered backend. I like to start with a folder that bears the project name, so in this case, I will go with Ch5
, as in Chapter 5 , Building the Backend for Our Application. A more natural name would be CarsApp
or something similar. Next, I am going to create a folder inside called backend and create a fresh Python environment inside of it. These are the steps:
- Create a folder named
Ch5
, or name it whatever you please. cd
into it and create a folder namedbackend
.cd
into the/backend
folder and create a Python environment with the following command:python -m venv venv
- The command will create a folder called
venv
. Activate the environment by typing the following command:venv\Scripts\activate.bat
- The Python environment should be now activated – you should have your command prompt prepended with
venv
. Now, it is time to install our Python dependencies. While in the same activated...