Authentication with django-allauth in Django Apps

Hi coders, In this article, I will show you how to setup Authentication with help of Django-allauth package in your Django App. We’re not going to use social authentication in this article. We will only see how to set up a normal username and password authentication with help of django-allauth.

So, Let’s start this guide.

Django-AllAuth Guide:

I’m going to use Virtual env in this guide with help of pipenv. If you are not using virual env then you can use pip to install Django and create a new project

django-admin startproject security_app

Installing Django-allauth package:

Now you have to install django-allauth package. So, install it using the following command:

pip install django-allauth

Once you’ve installed it, then You have to register it inside

Configuring file:

Now you have to add following required registration inside INSTALLED_APPS.



By default, some of the above will be already available inside your INSTALLED_APPS.

And then Add following code in your file:



# Provider specific settings
    'google': {
        'APP': {
            'client_id': '123',
            'secret': '456',
            'key': ''

Now in the end, configure your file.

Configuring file:

Now you need to import include method in and then add your allauth.urls at accounts path.

from django.contrib import admin
from django.urls import path, include

urlpatterns = [
    path('accounts/', include('allauth.urls')), # This one

Now finally all you have to do is to migrate:

python makemigrations

# and then 

python migrate

Now just create an admin user first, so that whenever users signup you could see all your registered users there. Type following command

python createsuperuser

So, once you have created you admin user then simply run your project on local server

>python runserver

Now simply goto there you will see all the URLs that are available.

Authentication with Python Django-Allauth in Django Apps


You can signup at accounts/signup/

Django-allauth authentication

Once you hit signup, then you will get an error page. don’t worry. this happens because we haven’t mentioned any redirected link yet.

Authentication in Django

But when you will check this inside your Django admin dashboard then you will see a new user is successfully created.

Similarly, you can use all other links e.g, login, logout, forget_password, etc.

You may also like: Django Rest Framework Full Guide

So, I hope you liked this article If yes then please don’t forget to share this with your friends. You can also subscribe to our blog to get future notifications from us.

Thanks to read.

Leave a Comment