Navigate to the directory containing your Django project settings (usually settings.py).
Inside settings.py, locate the SESSION_ENGINE setting and ensure it's set to "django.contrib.sessions.backends.db". If it's not, set it to this value.
Open a terminal or command prompt and navigate to your Django project directory.
Run the command python manage.py shell to open the Django shell.
Once inside the Django shell, run the following commands in sequence:
python
from django.contrib.sessions.models import Session
Session.objects.all().delete()
The above commands will clear all the sessions in your Django application.