This project implements how to use dj-rest-auth and django-allauth to sign up, sign in, authenticate users in drf applications.
TIP
This project uses "poetry" to manage dependencies. Ensure you have "poetry" already installed.
Read documentation here on how to install "poetry": https://python-poetry.org/docs/
You can still use "pip" to install the dependencies in the requirements.txt file
See this repository on how the environment setup was achieved: django_env_settings
└── root/
├── loggings/
│ ├── __init__.py
│ ├── base.py
│ └── local.py
├── manage.py
├── pyproject.toml
├── ruff.toml
├── requirements.txt
└── drfauth/
├── libs_config/
│ └── __init__.py
├── __init__.py
├── asgi.py
├── env.py
├── urls.py
├── wsgi.py
└── settings/
├── __init__.py
├── base.py
└── local.py
- Clone the repository
git clone https://github.com/cla-bit/drf-auth-setup.git
cd <your_project>
- Create your virtual environment
python -m venv <your_venv>NOTE
If using linux/MacOS terminal, use "python3".
- Activate your virtual environment
<your_venv>\Scripts\activateLinux/MacOS terminal
source <your_venv>/bin/activate- Install the dependencies using poetry or pip
poetry installor using pip
pip install -r requirements.txt- Make migrations
python manage.py makemigrations- Migrate to the database
python manage.py migrate- Start the django project
python manage.py runserver- Open the server on your browser and view the API endpoints
This project uses a CustomUser object instead of the default django User object.
With this knowledge, you will be able to setup completely and customize your django project to authenticate custom users.
TIP
drf-spectacular library was installed and setup for API documentation.

