Search⌘ K

Push the API to Github

Understand how to create a requirements.txt file with necessary dependencies and follow step-by-step instructions to push your Python FastAPI project to GitHub. This lesson prepares you for deploying the API to Microsoft Azure using CI/CD pipelines.

Create the requirements.txt file

We have created successfully the API in the previous chapter. Now is the time to push it on GitHub. We are doing this because we will be connecting this repository to Azure App Services for CI/CD.

Before doing that, we need to take one important step. We need to create a requirements.txt file that will contain the dependencies required to run our API. Follow the steps below to create the file:

  • Activate your virtual environment.

  • Go to your project folder.

  • Run the command shown below:

    pip freeze > requirements.txt
    
  • It will create a ...