Category "django-rest-framework"

How to get data from Django Rest Framework to GoogleMaps in JS

I am trying to build a web app which should get data from Django Rest Framework (using Serializer) and pass it to JavaScript and generate markers of GoogleMaps.

Send csv file in pytest test using restframework ApiClient

I'm trying to test my view which requires csv_file and one parameter in request, but getting error "details": {"csv_file": ["The submitted data was not a file.

SMTPConnectError (421, b'Server busy, too many connections')SMTPConnectError (421, b'Server busy, too many connections') [duplicate]

I have checked every single solution on other questions but they are of zero help,using bulk email services also require having a domain name

Django Rest Framework ignoring custom field

I have a model with a nullable boolean field that I'd like to have serialized in a way that converts null in the output to false. My model: class UserPreference

How to hide fields that belong to the model I'm inheriting from in django admin panel

I have these 2 models in my models.py class Student(AbstractBaseUser): date_of_birth = models.DateField(null=True) phone_number = PhoneNumberField(null=

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