Django Allauth
Django Allauth is an integrated set of applications addressing authentication, registration, account management, and third-party account authentication. Many other Django apps focus on social authentication but local authentication is not included. Allauth bridges that gap by integrating both local and social authentication in one package.
Prerequisites:
- Python 2.6, 2.7, or 3.3.
- Django (1.4.3+)
Features:
- It supports over 50 authentication providers.
- Auth flow helps customize forms.
- Provides local authentication along with social authentication.
Configuration:
Installing the all auth using pip:
pip install django-allauth
In the settings.py file add installed apps, templates, and authentication backends:
INSTALLED_APPS = [
# Other installed apps
"django.contrib.admin",
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.sessions",
"django.contrib.messages",
"django.contrib.staticfiles",
"django.contrib.sites",
# Social Authentication
"allauth",
"allauth.account",
"allauth.socialaccount",
# Social providers
"allauth.socialaccount.providers.github",
]
TEMPLATES = [
{
...
"DIRS": [str(BASE_DIR.joinpath("templates"))],
...
},
]
AUTHENTICATION_BACKENDS = [
'django.contrib.auth.backends.ModelBackend',
'allauth.account.auth_backends.AuthenticationBackend',
]
Top 10 Django Packages Every Developer Should Know
Python is one of the most popular languages for web development nowadays. It has various frameworks like Django, Flask, Hug, CherryPy, and Bottle that help developers write web applications in Python. Among all the frameworks Django is the most used framework to create websites in Python.
Django is an open-source and free-to-use full-stack web framework. It has several built-in libraries that support MySQL, SQLite, PostgreSQL, and Oracle as databases. It is a secure, stable, and scalable framework that helps us to create useful applications that are secure, stable, and scalable just like the framework.