I have made login/sign up using 2 factor authentication. React and Django are the frontend and backend frameworks used. I have used Node.js too for generating a qr code image, this didn't seem to be possible using Python/Django from the pyotp documentation.
docker-compose up
QR Code given after Registration, scan using Google authenticator:
Now head over to the login page.
Add the otp from Google authenticator:
Done!