Does this table need to be purged or is it taken care automatically by Django?
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Django __str__ returned non-string (type NoneType)
- Evil ctypes hack in python
On my
development server
, I prefer a database command overpython manage.py clearsessions
because you delete all sessions, not just the expired ones (here: mysql). So login into your database and do:BTW,
session
is not a database, but a table (django_session) and an app (django.contrib.sessions).Django 1.6 or Above
python manage.py clearsessions
Django 1.5 or lower
python manage.py cleanup
From Django Shell
from django.contrib.sessions.models import Session
Session.objects.all().delete()
django-session-cleanup cornJob
Django does NOT provide automatic purging. There is however a handy command available to help you do it manually: https://docs.djangoproject.com/en/dev/topics/http/sessions/#clearing-the-session-store