The best way for that is to using Django Allauth, You can do anything with that secure and easy, For sure Allauth have many other options for you.