This repository contains the code for my Medium article on Authentication and authorization in Django RESTful APIs using Dj-Rest-Auth with Gmail server for sending verification emails to users. A CRUD app example was used.
- Have
Pythonandpipinstalled on your local machine
Create an isolated environment for the project with virtualenv. You can install virtualenv with the following command:
sudo pip install virtualenv
Create a new directory for the project:
mkdir myproject && cd myproject
Create a virtual environment for the project:
virtualenv envThen, activate it:
source env/bin/activateClone the project from GitHub:
git clone https://github.com/J-rayX/drfauthprojectInstall Django and Django REST Framework:
pip install django djangorestframeworkFinally, cd into the drfauthproject folder and run the project:
python manage.py runserverGo to http://localhost:8000/ to see if the API is up and running.
Now, you can follow the article on Medium to learn how to implement authentication and authorization for your Django REST APIs. You will also learn how to use Gmail smtp server to send verification and password-reset emails to users.
We move! 💪