Nanda Kishore
Nanda Kishore

Reputation: 2809

Manually logging out a user, after a site update in Django

I have a website, which will be frequently updated. Sometimes changes happen to User specific models and are linked to sessions.

After I update my site, I want the user to log out and log back in. So I would log out the user right then. If he logs back in, he will see the latest updates to the site.

How do I do it?

Upvotes: 1

Views: 1062

Answers (2)

defrex
defrex

Reputation: 16425

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

Upvotes: 10

S.Lott
S.Lott

Reputation: 391854

See this: http://docs.djangoproject.com/en/dev/topics/auth/#how-to-log-a-user-out

That seems to cover it.

Upvotes: -1

Related Questions