I am using django-rest-knox 4.1.0 . In its documentation it says that expired tokens are deleted automatically. But it is not deleting the tokens.
REST_FRAMEWORK = {
"DEFAULT_AUTHENTICATION_CLASSES": (
"knox.auth.TokenAuthentication",
),
}
REST_KNOX = {
"SECURE_HASH_ALGORITHM": "cryptography.hazmat.primitives.hashes.SHA512",
"AUTH_TOKEN_CHARACTER_LENGTH": 321,
"TOKEN_TTL": timedelta(minutes=10),
}
In settings.py I gave 10 minutes for expiration of token (for testing purposes). "TOKEN_TTL": timedelta(minutes=10)
I check the database after that time, they are not deleted. pgadmin knox token table Also I try to send request with those expired tokens, the respond is successful.