Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

396
Views
django test framework token authentication — is there any way to log everyone out?

I understand that token authentication doesnt really have the concept of logging out— that a token merely identifies a user.

Is there any way to invalidate all tokens? Maybe via the change of some variable from which all the tokens are generated— causing everyone to need to log in again?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

I guess it depends a bit on which auth system you are using. In case you are using rest_framework.authtoken, you could simply clear the Token table:

from rest_framework.authtoken.models import Token
Token.objects.all().delete();

No token, not logged in ;)

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!