Home / Companies / LaunchDarkly / Blog / Post Details
Content Deep Dive

Quickly disable external API calls in your FastAPI application using FastAPI and LaunchDarkly kill switch flags

Blog post from LaunchDarkly

Post Details
Company
Date Published
Author
Tilde Thurium
Word Count
1,314
Language
English
Hacker News Points
-
Summary

This tutorial demonstrates how to add a kill switch feature flag to disable third-party API calls in a FastAPI application using the LaunchDarkly Python SDK. The Dad Jokes API is used as an example data source. FastAPI, a new Python framework, offers benefits such as built-in concurrency support and auto-generated interactive documentation. The tutorial covers setting up a local developer environment with Python and pip installed, creating a requirements.txt file for dependencies, and building the FastAPI application. It also explains how to configure LaunchDarkly kill switch flags and integrate them into the FastAPI application using lifespan events. Finally, it demonstrates how to test the feature flag by enabling and disabling it in the LaunchDarkly dashboard.