Session database table cleanup
I know this post is old but I tried this command/attribute and it worked for me.
In the 'base.html' file, I inserted:
{{ request.session.clear_expired }}
This clears expired records from the django_session table when the user clicks on any link in the template after the session expires.
Even so, it is necessary to create a routine to clear expired records over a period longer than one day. This is necessary to clear logs when user closes browser with open sessions.
I used Django 3.2.4
Does this table need to be purged or is it taken care of automatically by Django?