Category "django-rest-framework"

How to pass request object from one serializer class to other serializer class in Django

I want to access userId of current logged-in user. for that i need to pass the request object from one serialiser to another. Here's my code class ThreadViewSer

Django drf simple-jwt authentication"detail": "No active account found with the given credentials"

I am implementing user authentication with django-rest_framework_simple-jwt with custom user, My models.py: class UserManager(BaseUserManager): def create

Django REST: Files\Images Uploading

Im want to upload an image using Vue.js and Django-rest. And have few problems with it. Im trying to use put request (as in docs) and FileUploadParser for it,

Authorization: Any Benefit of OAuth2 for First-Party Web and Mobile Clients

I would like to know whether there is any security benefit to using OAuth2 for authorization where all clients are developed, owned and controlled by the API de

Authorization: Any Benefit of OAuth2 for First-Party Web and Mobile Clients

I would like to know whether there is any security benefit to using OAuth2 for authorization where all clients are developed, owned and controlled by the API de

Pyinstaller doesn't include django rest framework templates

I have a django app that uses rest_framework, and everything works perfectly, I am using pyinstaller to get an exe for this app, the executable app works fine,

How to consume TokenAuthentication based user authentication built in DRF in Django web application

I have created a WebAPI for user authentication using Token Authentication built on Django Rest Framework. with the help of Postman I am able to determine that

Django: How to make json data readable in django?

i am trying to retrieve the lastest news from hackernews api, everthing seems to be working fine and when i print the status code, i get Status Code:200. Now i

Django Rest Framework : Authentication credentials were not provided

Images in the current database have one piece of data. But, I am currently experiencing the following error "GET /images/all/ HTTP/1.1" 401 58" "detail": "Au

DRF show different fields on 'list' and 'get_object' [duplicate]

I am using viewsets like this: class UserViewSet(viewsets.ModelViewSet): """Viewset for model User.""" queryset = User.objects.all()

django channels WebsocketCommunicator TimeoutError

I am trying to run the following test: tests.py from rest_framework.test import APITestCase from myapp.routing import application from channels.testing import W

filefield serializer is not parsing the file object

I have a model in my application: class GRNRFIDSerials(models.Model): grn = models.ForeignKey(Grn, on_delete=models.CASCADE) file = models.FileField(up

How to check if a request consists of session id and csref token in the cookie in Django rest framework?

my rest_framework authentication and permission classes "DEFAULT_PERMISSION_CLASSES": [ "rest_framework.permissions.IsAuthenticated", "rest_fra

Nested Category In django

how do I use nested categories in django as Im nwe to django and doing this and find some solutions but didnt work anything class MainCategory(models.Model)

Object of type <> is not JSON serializable Django REST Framework

I am trying to create a search function inside my class-based view using Django Rest Framework, but it does not seems to work. when I try to search for some cus

Why did the Django model return an empty queryset in the thread pool?

I used ThreadPoolExecutor in my API. in the test case, I generated a Movie instance and saved it in the database (PostgreSQL). I printed movie count in the test

csrf cookie not set on linux

I know this question is quite popular, before asking it, I researched all the previous questions and their answers, but never found a solution for myself. My pr

How to login with mobile/otp using Django Oauth Toolkit

We are using Django OAuth Toolkit with DRF(Django Rest Framework). Now, we want to provide login with mobile number. To authenticate we'll use OTP(One Time Pass

Problem while using mypy with my django project

I have implemented mypy in my django rest framework but I am getting errors ModuleNotFoundError: No module named 'config' while running mypy.Is there any wrong

Endpoints sharing part of an URL

I'm currently building an API with Django Rest Framework and I want to have two viewsets. One related to my User model, and one single route to verify a User em