Here are examples of DUO secondary authentication into PHP and Python Web Servers user login services.
These codes are proof of concepts which shoud help to understand how it works and how integration can be easily done.
You will find here 1 PHP example
And python Flask examples.
A basic one coming from the DUO Web documentation. And a second one which gives the same result as the PHP example.
In addition to this you will find as well python DUO client examples. ( Or how to add DUO MFA to a RFID Tag autentication Application )