Category "django-rest-framework"

Understanding working of multiple gunicorn process

I have no knowledge of what I'm trying to understand, surfing the internet brought me here and now I need this in my code. I use django-rest-framework, gunicorn

How to validate AzureAD accessToken in the backend API

I just wanted to know how can we validate the azure ad access token in a backend API in my case i.e. Django rest framework. Consider that I have a single page a

Pytest models not getting imported due Apps aren't loaded yet

nas_apps nas_apps -__init__.py -environments.py -settings.py -urls.py -wsgi.py -pytest.ini usecase1 -co

how to get a username to show on serializer django rest framework

how would i get the user name to show in the serializer along wit the data. I tried doing serializer char field but did not work. Model class Pet(models.Model

Import "rest_framework" could not be resolved. But I have installed djangorestframework, I don't know what is going wrong

Here's my settings.py: INSTALLED_APPS = [ 'rest_framework', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'd

'RegisterAPI' should either include a `serializer_class` attribute, or override the `get_serializer_class()` method

I am trying to display a register_view here and I'm getting the error. I have made some changes to the views fil,e but i am still getting the errors and i don't

Issue with Django logout URL redirection

I have configured login and logout redirect setting in Django settings as below - LOGOUT_REDIRECT_URL = '/login/' LOGIN_REDIRECT_URL = '/locations/' However,

Trying To Retrieve Name Instead of Primary Key, But Django Rest Framework complains of Value Error. If I try to fix it, I got other errors too

My Models: def upload_to(instance, filename): return 'images/{filename}'.format(filename=filename) class StreamPlatform(models.Model): name = m

Serializing reverse relationship of a ForeignKey with a DRF ModelSerializer

I'm trying to generate a data structure following this sample: [ { "name": "groupname", "key": "grouping1", "base_templates": [ { "i

Why is request.user is anonymous in Django RedirectView?

There are a lot of questions similar to this one, but none quite capture the situation I am in. I am coding a Django/ React app and I have integrated with Spoti

Django - How do i check whether a date has expired inside filter condition

How do i check whether a date has expired or not with respect to today in filter condition. eg: task = Task.objects.filter(job=obj, status__in = ["in-progress"

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