Incorporating Kagi for 2FA

I am trying to figure out how to use Kagi for 2FA. I managed to get Kagi running on the Django server, and it looks fine. Forgive me, but what is the best way to incorporate this into an existing project? I’m not sure how to proceed.

Thanks.