Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to configure Django Rest Framework to store token information in Redis rather than the Database?

Is there a way to configure Django Rest Framework to store token information in Redis rather than the Database ?

like image 302
Amogh Talpallikar Avatar asked Aug 26 '14 09:08

Amogh Talpallikar


1 Answers

You can create your own custom authentication backend which stores tokens in redis. From the documentation:

To implement a custom authentication scheme, subclass BaseAuthentication and override the .authenticate(self, request) method. The method should return a two-tuple of (user, auth) if authentication succeeds, or None otherwise.

like image 107
bspink Avatar answered Oct 13 '22 01:10

bspink