Category "django-rest-framework"

filter API response based on URL parameters that both exactly matches and also the substring of the parameter matches in Django

I need to filter API response based on URL parameters that both exact match and also the substring of the parameter matches in Django. The API call would be : "

routes to manage groups and permissions with rest api endpoints in django

What is the best way to manage groups and permissions with django-rest-framework API endpoints? I want to have all functionalities that admin panel has to manag

Django high memory usage

I'm using django as a backend for a React frontend, and deploying both applications on Heroku. I also use Gunicorn do serve the application and signed the Hobby

Change Header Key for rest_framework's TokenAuthorization

By default, rest_framework's TokenAuthentication uses the "Authorization" key in the header, and looks for the keyword "Token" when authenticating requests. Aut

Django REST Framework Render a result from an hyperlink in API response

I am building an application with a DRF/React stack, and I have a bit of an issue. I am using a HyperlinkedModelSerializer to be able to easily make a GET reque

Integrity Error on DRF on fixture teardown

I have these 2 models in Django: class Invoice(models.Model): id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) owner = model

API view returning { "detail": "Not found." },

class User(models.Model): user_id = models.CharField(max_length=255, unique=True) mobile = models.CharField(max_length=12) first_name = models.CharF

Custom field with special constrains in DRF serializer

I'm trying to add a custom field with some special constrains in DRF serializer. Following are 2 sample models: class ModelA(models.Model): field1 = models.

Django: The QuerySet value for an exact lookup must be limited to one result using slicing

i am tring to access a page using a slug url, but i keep getting this error The QuerySet value for an exact lookup must be limited to one result using slicing.

Django rest framework jwt {"detail": "You do not have permission to perform this action."}

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 perf

Update array of ManyToMany field in Django REST framework

I have a Model Plot which looks like this: from django.db import models class Plot(models.Model): class SUNSHINE(models.TextChoices): NONE = N

Django unable to serve static files from s3 bucket

I created a few models and pushed my project to a development server on an AWS EC2 instance. I used Django storages and followed the docs to configure my settin

I need to split array to sub arrays of similar values in python

lets suppose i have this queryset_array: queryset_array = [{"category":"a"},{"category":"a"},{"category:"b"},{"category":"b"},{"category":"c"},{"category":"c"}]

I need to apply the values_list() function to queryset after filtering

Following is my View Class: from apps.embla_services.filters import RentPostFilters from django_filters import rest_framework as filters from apps.embla_service

I need to apply the values_list() function to queryset after filtering

Following is my View Class: from apps.embla_services.filters import RentPostFilters from django_filters import rest_framework as filters from apps.embla_service

Django Authorization Checking in URL having wild card pattern

I am trying to implement permission checking mechanism in URLs for a request using wildcard techniques, rather than implement permission checking on each views.

How to get the param PK in django restframework permission?

I have this permission in Django that look like this: class PermissionName(BasePermission): def has_object_permission(self, request, view, obj):

Want to send extra data from BasePermission to Queryset in ModelVIewSet DRF

Here is My Seller Model which has User as OneToOneField #models.py . . class CompanyProfile(models.Model): user = models.OneToOneField(User, on_delete=mode

Trying to retrive JSON Array through fetch in react native but JSON parse error:Unreconised token "<"

In the code,i am fetching the token from expo-secure-store,later fetching the API data from fetchdata function.But unfortunately error "unrecognized token" is

Images disappears from django web app deployed to heroku

I am working on a django project, writing rest APIs with django rest framework to use them in android application, my main idea is develop back end in django an