3 ms·
If you want JWT, you can use https://github.com/GetBlimp/django-rest-framework-jwt https://github.com/GetBlimp/django-rest-framework-jwt -- that provides anothe
by theptip 8y ago
If you want JWT, you can use https://github.com/GetBlimp/django-rest-framework-jwt https://github.com/GetBlimp/django-rest-framework-jwt -- that provides another authentication class, and you can then auth with `Accept: Bearer <jwt>`.
If you don't need JWT (I'd probably leave it out next time round) then Django Rest Framework comes with a simpler bearer token auth class (among others): http://www.django-rest-framework.org/api-guide/authentication/#tokenauthentication http://www.django-rest-framework.org/api-guide/authenticatio....
edit to add - if you're asking specifically about sharing sessions between the JS app and the Django server-side form, I believe this is what you're looking for:http://www.django-rest-framework.org/api-guide/authentication/#sessionauthentication http://www.django-rest-framework.org/api-guide/authenticatio..., i.e. you'll still need to pass the csrf token into the JS app.