django-rest-auth

Djoser for DRF with Knox tokens

十年热恋 提交于 2021-02-19 05:21:29
问题 I'm trying to use djoser with token authentication, but using django-rest-knox tokens. I have set the TOKEN_MODEL to knox.models.AuthToken , and the rest framework's DEFAULT_AUTHENTICATION_CLASSES to knox.auth.TokenAuthentication . I naïvely thought that this would be enough, but it seems that Djoser's inbuilt serializers (create token, and token), don't work properly with the knox tokens. I tried overriding them with custom serializers, but I didn't get anywhere (which is not to say it's not

Djoser for DRF with Knox tokens

别来无恙 提交于 2021-02-19 05:21:28
问题 I'm trying to use djoser with token authentication, but using django-rest-knox tokens. I have set the TOKEN_MODEL to knox.models.AuthToken , and the rest framework's DEFAULT_AUTHENTICATION_CLASSES to knox.auth.TokenAuthentication . I naïvely thought that this would be enough, but it seems that Djoser's inbuilt serializers (create token, and token), don't work properly with the knox tokens. I tried overriding them with custom serializers, but I didn't get anywhere (which is not to say it's not

Djoser for DRF with Knox tokens

柔情痞子 提交于 2021-02-19 05:21:11
问题 I'm trying to use djoser with token authentication, but using django-rest-knox tokens. I have set the TOKEN_MODEL to knox.models.AuthToken , and the rest framework's DEFAULT_AUTHENTICATION_CLASSES to knox.auth.TokenAuthentication . I naïvely thought that this would be enough, but it seems that Djoser's inbuilt serializers (create token, and token), don't work properly with the knox tokens. I tried overriding them with custom serializers, but I didn't get anywhere (which is not to say it's not

Djoser for DRF with Knox tokens

萝らか妹 提交于 2021-02-19 05:20:13
问题 I'm trying to use djoser with token authentication, but using django-rest-knox tokens. I have set the TOKEN_MODEL to knox.models.AuthToken , and the rest framework's DEFAULT_AUTHENTICATION_CLASSES to knox.auth.TokenAuthentication . I naïvely thought that this would be enough, but it seems that Djoser's inbuilt serializers (create token, and token), don't work properly with the knox tokens. I tried overriding them with custom serializers, but I didn't get anywhere (which is not to say it's not

Token authentication does not work in production on django rest framework

主宰稳场 提交于 2021-02-08 12:34:09
问题 I have this strange issue and I can't find why. I've build the API using django 1.7 and django rest framework and token auth for api authentication. All works fine on local host, but when I'm trying to call an API endpoint which requires authentication on production machine I'm getting 403 status code along with the following message: {"detail":"Authentication credentials were not provided."}. What I'm doing wrong? I'm sending the token in the headers as per documentation. Here's how my

Token authentication does not work in production on django rest framework

只愿长相守 提交于 2021-02-08 12:34:00
问题 I have this strange issue and I can't find why. I've build the API using django 1.7 and django rest framework and token auth for api authentication. All works fine on local host, but when I'm trying to call an API endpoint which requires authentication on production machine I'm getting 403 status code along with the following message: {"detail":"Authentication credentials were not provided."}. What I'm doing wrong? I'm sending the token in the headers as per documentation. Here's how my

django-rest-auth handling expired confirmation email

孤人 提交于 2021-02-08 12:11:48
问题 I am using django-rest-auth and django-allauth to handle user authentication in my rest api. When a user tries to verify their email after the link has expired, I get an unpleasant error page. Please, how can I display a better error page or send a message telling them it wasn't successful because the link had expired? 回答1: As far as I can understand, your error is coming from django-allauth , not from your project. Reason for the error is that you did not include allauth.url in your main

remove authentication and permission for specific url path

断了今生、忘了曾经 提交于 2021-02-06 12:59:48
问题 I'm working with DRF and came across this issue. I have a third-party view which I'm importing in my urls.py file like this : from some_package import some_view urlpatterns = [ path('view/',some_view) ] but the issue I'm facing is since I have enabled default permission classes in my settings.py like this: REST_FRAMEWORK = { 'DEFAULT_AUTHENTICATION_CLASSES': ( 'rest_framework.authentication.TokenAuthentication', ), 'DEFAULT_PERMISSION_CLASSES':( 'rest_framework.permissions.IsAuthenticated', )

remove authentication and permission for specific url path

帅比萌擦擦* 提交于 2021-02-06 12:58:25
问题 I'm working with DRF and came across this issue. I have a third-party view which I'm importing in my urls.py file like this : from some_package import some_view urlpatterns = [ path('view/',some_view) ] but the issue I'm facing is since I have enabled default permission classes in my settings.py like this: REST_FRAMEWORK = { 'DEFAULT_AUTHENTICATION_CLASSES': ( 'rest_framework.authentication.TokenAuthentication', ), 'DEFAULT_PERMISSION_CLASSES':( 'rest_framework.permissions.IsAuthenticated', )

How to add change password functionality to Django / React app

可紊 提交于 2021-01-28 02:06:47
问题 I'm trying to add change password functionality to a Django / React app. I'm struggling to find any way to make this work. I'm using django-rest-auth and django-rest-framework. I would be happy to either submit the password change request from a React page, or else to redirect the user to the native Django template-driven page - leaving my SPA, but acceptable to get the functionality working. However, the change password page requires the user to be logged in, and I can't see how to do this