I have a website,which will be frequently updated. Sometimes changes happen to User specific models and are linked to sessions. So after I update my site, I want the user to logout and log back in. So I would logout the user right then. If he logs back in, he will see the latest updates to the site.How do I do it?
+8
A:
You could just reset your session table. This would logout every user. Of course, depending on what your doing with sessions, it could have other implications (like emptying a shopping cart, for example).
python manage.py reset sessions
Or in raw SQL:
DELETE FROM django_sessions
defrex
2009-07-10 04:04:59
for some it might be easier to just log into a database manager (phpPgAdmin, phpMyAdmin, etc), and just empty the `django_sessions` table. It has the same effect.
nbv4
2009-07-10 04:52:24
A:
See this: http://docs.djangoproject.com/en/dev/topics/auth/#how-to-log-a-user-out
That seems to cover it.
S.Lott
2009-07-10 10:18:27
Hello Lott, this is the normal logout, which can be called on demand. But what I wanted is a different one. Automatic logout of all users(ofcourse keeping in mind defrex suggestion on shopping carts) upon a site update.
Maddy
2009-07-13 05:02:59