I haven't changed the settings of Knox in my Django app. The default expiry time is 10hours, how can I change this that it won't expiry.
How can I extend expiry time of Knox-Token
1.4k Views Asked by Shahobiddin Khusniddinov At
        	3
        	
        There are 3 best solutions below
1
                 On
                        
                            
                        
                        
                            On
                            
                                                    
                    
                Change the TOKEN_TTL item on REST_KNOX.
Based on docs.
TOKEN_TTL
This is how long a token can exist before it expires. Expired tokens are automatically removed from the system.
from datetime import timedelta
from rest_framework.settings import api_settings
REST_KNOX = {
  'SECURE_HASH_ALGORITHM': 'cryptography.hazmat.primitives.hashes.SHA512',
  'AUTH_TOKEN_CHARACTER_LENGTH': 64,
  'TOKEN_TTL': timedelta(hours=10),  # default time 10h
  'USER_SERIALIZER': 'knox.serializers.UserSerializer',
  'TOKEN_LIMIT_PER_USER': None,
  'AUTO_REFRESH': False,
  'EXPIRY_DATETIME_FORMAT': api_settings.DATETME_FORMAT,
}
Look at docs for more info.
TOKEN_TTL