May 11, 2025
What does clearsessions command do in Django?
We can clear database expired session in Django by using clearsessions command. This command is very helpful to cleanup expired session records present session table. We do not need to remember table name, by running single command table cleanup happened automatically. Syntax for clearsessions is mentioned below:
Sample Code
python manage.py clearsessions