In this article, you'll learn how to add two-factor (2FA) authentication to a Django REST API using TOTP tokens generated by an Authenticator app like Chrome's Authenticator extension, Authy or Google Authenticator.
https://codevoweb.com/django-implement-2fa-two-factor-authentication/