Skip to main content
Stack Overflow for Teams is now Stack Internal: See how we’re powering the human intelligence layer of enterprise AI. Read more >
Filter by
Sorted by
Tagged with
1 vote
2 answers
795 views

I am doing a project with REST API and Django Rest Framework. I currently have an issue in my post request where some of my endpoints return HTTP 401 Unauthorized, though all other get or update ...
Sabab's user avatar
  • 35
-1 votes
2 answers
1k views

I am currently a student working on my project and i am having a bit of trouble with my signin page. when I attempt to sign in, I receive a 200 HTTP response indicating that successful sign in to the ...
Jamie Connell's user avatar
0 votes
1 answer
207 views

I am not an expert of setting up the settings file in DRF. I want to use React and DRF for authentication and this is my code INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', ...
Denis Tosh's user avatar
0 votes
2 answers
235 views

In my django rest app i like to change the default error response from JWTAuthentication. Currently my application is using JWT With django to work on login and logout (which blacklists the token). ...
Yash Marmat's user avatar
  • 1,205
0 votes
0 answers
127 views

models.py class Customer(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE) mobile = models.PositiveBigIntegerField(unique=True) def __str__(self) -> str: ...
user22257988's user avatar
-1 votes
2 answers
69 views

Is it possible to get all the values of foreign key instead of id? class WishlistSerializer(serializers.ModelSerializer): def to_representation(self, instance): rep = super(WishlistSerializer, ...
charan teja's user avatar
1 vote
1 answer
472 views

I want to log in on Flutter, but it does not remain Authenticated in Django as well as on Flutter. I just want the user to stay logged in on Flutter by storing tokens so it remains authenticated, but ...
Shahan's user avatar
  • 11
1 vote
0 answers
82 views

I'm trying to build a Rest Api Using Django.For the authentication i decide to use JWT but when i make a request using Postman, i got this error : "detail": "No active account found ...
Cephas BERE's user avatar
1 vote
1 answer
245 views

In my django rest framework project I used json web token based authentication and custom user model I want to access requested user object to pass as foreign key when I try request.user it will ...
Muhammed Rinshid's user avatar
0 votes
1 answer
2k views

from django.db import models from django.contrib.auth.models import AbstractUser class ExtendUser(AbstractUser): email = models.EmailField(blank=False, unique=True) EMAIL_FIELD = 'email ...
Alotab's user avatar
  • 19
1 vote
1 answer
1k views

I am generating a custom jwt token for authentication using RefreshToken.for_user(user) at the time of login and registration. I can access user using request.user in the API endpoint but I also want ...
Alex Advent's user avatar
1 vote
1 answer
579 views

I am migrating our Django code that uses djangorestframework-jwt to the latest version of djangorestframework-simplejwt(5.2.2) in Django 4.0.8. I am having an issue while trying to verify the token. ...
sandpat's user avatar
  • 1,495
0 votes
4 answers
1k views

I'm following a course on user login and registration and I'm getting this error and I don't know how to fix it detail": "Method \"GET\" not allowed. urls.py from django.urls ...
Martin Arreola's user avatar
0 votes
1 answer
756 views

I'm following a Udemy Course with user administration and I need to install this pip install djangorestframework-simplejwt After its installed, I need to add this to settings.py REST_FRAMEWORK = { ...
Martin Arreola's user avatar
4 votes
2 answers
10k views

I installed djangorestframework as shown below: pip install djangorestframework -jwt Then, I used rest_framework_jwt.views as shown below: from rest_framework_jwt.views import ( obtain_jwt_token, ...
KIRAN KUMAR N's user avatar
2 votes
1 answer
130 views

When I set default permission settings to "DEFAULT_PERMISSION_CLASSES": [ "rest_framework.permissions.AllowAny", ], and then define different permission for views like ...
famdude's user avatar
  • 147
1 vote
1 answer
4k views

I have struggling with getting information from Django rest framework as a backend and from the frontend using flutter. The sequence of the project of the project is that I login and receive a {"...
A_K's user avatar
  • 992
0 votes
0 answers
582 views

I'm using JWT token auth in django. I set access-token timing to '1 minute' after 1-min the access & refresh token get expire and but when i try to access API url it gives access and show data. i ...
Vaibhav Dhawale's user avatar
0 votes
1 answer
1k views

I've created the employee management system using django rest api. I've created the models, views and serializers like shown below. What i need is I've created employee details like his personal ...
orange freeze's user avatar
1 vote
1 answer
392 views

Actually I'm creating an employee management system project using django rest api. Now i have created my own custom models like shown below, i want to create the register employee with the below ...
orange freeze's user avatar
1 vote
1 answer
435 views

modules present in requirements.txt asgiref==3.5.2 backports.zoneinfo==0.2.1 Django==4.0.5 djangorestframework==3.13.1 djangorestframework-simplejwt==5.2.0 PyJWT==2.5.0 pytz==2022.2.1 sqlparse==0.4....
Piyush Ranjan Chaudhary's user avatar
0 votes
0 answers
210 views

halo i'm working on a project, using drf, but i'm getting CSRF verification failed. Request aborted at first everything was working, but now when i test my api i keep keep getting,CSRF verification ...
Tosin Ayoola's user avatar
0 votes
1 answer
2k views

Currently I am using JWT (rest_framework_simplejwt) with Django Rest Framework. The database table containing tokens got bigger and bigger. Is there any way to delete all expired access tokens from ...
Moustapha's user avatar
0 votes
1 answer
896 views

The rest framework has its default web-based API-authentication path('api-auth/', include('rest_framework.urls', namespace='rest_framework')), However, once JWT authentication is added and the ...
juanjuan's user avatar
0 votes
1 answer
1k views

my views.py file: from rest_framework.views import APIView from rest_framework.response import Response from .serializers import UserSerializer class TestView(APIView): def get(self, request, ...
falcon's user avatar
  • 31
1 vote
3 answers
3k views

Their official doc only shows implementation for class based views. How to get this done for a function, ie. Refreshtoken.for_user()? from rest_framework_simplejwt.tokens import RefreshToken def ...
Partho KR's user avatar
  • 132
1 vote
1 answer
2k views

I am trying to make a request using django-rest-framework and django-rest-framework-jwt but The response that I get detail": "You do not have permission to perform this action." views....
hasan bilal's user avatar
0 votes
1 answer
2k views

I'm using simpleJWT with Django restframework and i get this problem when i tried to refresh the access token, i post http request sending the refresh token to the refresh endpoint, it suppose to get ...
Oussama Tachi's user avatar
2 votes
1 answer
2k views

I'm using: Django==3.2.9 djangorestframework==3.12.4 djangorestframework-simplejwt==5.0.0 I want to make a login system that takes either username or email and password as a parameter from a user. ...
Nawaraj Jaishi's user avatar
1 vote
1 answer
346 views

I have a machine learning model which I have converted as a Rest API using Django rest framework. Now I want to distribute the API to users but how can I authenticate and limit the requests by the ...
harsh's user avatar
  • 595
0 votes
1 answer
1k views

Recently I am studying and building API with Django. I successfully set up the API of authentication system with Django API. I am curious to know that is there any solution to add this JWT with ...
Anny's user avatar
  • 303
1 vote
1 answer
3k views

I'm trying to create Club object via React form but I get those 2 errors: {"detail": "Authentication credentials were not provided."} and 401 Unauthorized. Obviously there is ...
mateuszlaczynski's user avatar
0 votes
1 answer
625 views

Set custom return error when using rest framework jwt token verification,ImportError: Could not import 'users.authenticate.jwt_response_payload_handler' for API setting 'JWT_RESPONSE_PAYLOAD_HANDLER'. ...
Lee's user avatar
  • 1
1 vote
0 answers
164 views

I have a project with JWT authentication in Django Rest Framework. Usually I require user to be authenticated but in the case of GET action (both list and retrieve) I would like everyone to be able to ...
MartynaMajch's user avatar
0 votes
1 answer
2k views

I have made a view where I send a Refresh Token to email for activation account purpose. If token is valid everything works fine. The problem is when jwt token expire, I want to be able in backend to ...
Rares D's user avatar
  • 123
0 votes
0 answers
46 views

I need to create an authentication for a distributor using jwt. However I'm only able to create the authentication token for the superuser. Could someone help me create a way to authenticate the ...
afonso's user avatar
  • 37
0 votes
1 answer
2k views

I need to get access token and refresh token in a single API, Currently I have 2 API's for both access and refresh tokens url(r'^token-auth', view.ObtainJWTView.as_view(), name='token-auth'), url(r'^...
sarath sathyan's user avatar
0 votes
1 answer
1k views

I'm newbie in Django Restframework. I use JWT to make login, register API, everythings worked well, I want to GET a user information with authenticated (tokens). This is my code for UserViewSet class ...
Chen Triều's user avatar
0 votes
1 answer
261 views

I am building a backend authentication in Django-Rest_framework using django-rest-auth and REST framework JWT Auth and when I login I keep getting this error. What am I doing wrong? AttributeError at /...
CodingRaz's user avatar
  • 143
2 votes
0 answers
400 views

I`m using Auth0 authentification in a webapp / django-server combination. Auth0 is not the fastest auth framework, it always takes 200ms to authenticate. My webapp sends a lot of requests to the ...
user1383029's user avatar
  • 2,155
1 vote
1 answer
4k views

How can i redirect user to obtain new access token in refresh token view if access token is expired ? i implemented cookie based authentication with simple jwt library in django rest framework. ...
Zero0's user avatar
  • 504
1 vote
1 answer
855 views

I have a proxied user model: class TheDude(User): class Meta: proxy = True And I'm using the Django REST framework JWT to do JWT auth in the REST API. I'd like to get the user object from ...
Rudiger's user avatar
  • 6,719
1 vote
0 answers
517 views

Pardon me but I am a bit new to Django, Django does not even tell me the field having issues I keep getting an error I don't understand How do I know the field having issues? When I try to fetch a ...
MIike Eps's user avatar
  • 441
0 votes
1 answer
149 views

I have a question. In my project, after a user loges in my app generates an access token and then put it on cookies. This access token contains information like user rights and some other details ...
Samartean Marian's user avatar
3 votes
3 answers
9k views

I have created a custom user model and apply Djoser authentication and jwt. But after this when I tried to get request for products views, I get this error: "detail": "Authentication ...
Hasnain Sikander's user avatar
0 votes
1 answer
4k views

I am trying to make REST APIs using Django. I have installed djangorestframework & djangorestframework-simplejwt using pip pip install djangorestframework pip install djangorestframework-simplejwt ...
Ali Shah Meghani's user avatar
0 votes
0 answers
315 views

i have used restframework_jwt with RS256 algorithm, and successfully created access token. But i am getting a error "Could not deserialize key data." when try to use this token as ...
Saran Prasad's user avatar
1 vote
1 answer
414 views

I'm rather confused regarding the following error: "Forbidden (CSRF cookie not set.)". This error is received during attempting to logout, login, signup. The problem is similar to this post ...
djo's user avatar
  • 149
0 votes
0 answers
2k views

I am trying to work with djangorestframework-simplejwt and trying to follow this tutorial: https://www.jetbrains.com/pycharm/guide/tutorials/django-aws/rest-api-jwt/ Currently I'm at this point where ...
Tony Hoan Trinh's user avatar
1 vote
1 answer
2k views

I want to implement my own custome error message when user types wrong password in Django Rest JWT authentiction as of now default error message is "detail": "No active account found ...
lord stock's user avatar
  • 1,221

1
2 3 4 5