I have successfully implemented two-factor-auth package to my web app however I would like to display QR code to a template when a user is logged in but am unable to do so as it stands.
This package uses wizard forms and when a user is prompted to setup two factor the QR code is displayed during setup for them to scan on their chosen device but not sure how to use the QR code for later use in another template.
I found the follwing piece of code from the wizard template which I tried to use but says page not found:
<div class="d-flex justify-content-center">
<p><img src="{{ QR_URL }}" alt="QR Code" /></p>
</div>
Page not found error
Using the URLconf defined in wfi_workflow.urls, Django tried these URL patterns, in this order:
admin/
account/login/ [name='login']
account/two_factor/setup/ [name='setup']
account/two_factor/qrcode/ [name='qr']
The current path, account/two_factor/qrcode/, matched the last one.
But I can view the QR code for users via Admin panel under:
- Otp_Totp
- TOTP devices
- Click on user and QRCode link is at the bottom of page
Anyone know how to go about displaying the QR code only in another template? If more info is required do let me know. Thanks