Posts

Showing posts with the label OAuth

User Registration in Django using Google OAuth

Image
Open Authorization (OAuth) is a service that allows websites or apps to share user information with other websites without being given a users password. Users can log in to multiple websites with the same account without creating other credentials. Some of the most popular OAuth service providers are Google, Facebook and GitHub. In this tutorial, we look at registering users in a Django app using Google OAuth. Prerequisites Step 1 – Create and set up a new Django project $ python3 -m venv virtual $ source virtual/bin/activate $ pip install django $ django-admin startproject oauth_project . $ python manage.py startapp oauth_app $ python manage.py migrate INSTALLED_APPS = [ #... 'django.contrib.sites' , 'oauth_app' , ] Step 2 – Install and set up  django-allauth $ pip install django-allauth INSTALLED_APPS = [ #... 'allauth' , 'allauth.account' , 'allauth.socialaccount' , 'allauth.socialaccount.providers.google&