Django OTP and AD Login

Hi is it possible to use ad for login and register for OTP in Django? Cause I was trying to use django to implement some functions from erpnext like adding a new module.