class User(models.Model): user_id = models.CharField(max_length=255, unique=True) mobile = models.CharField(max_length=12) first_name = models.CharF
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.
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.
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
I have a Model Plot which looks like this: from django.db import models class Plot(models.Model): class SUNSHINE(models.TextChoices): NONE = N
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
lets suppose i have this queryset_array: queryset_array = [{"category":"a"},{"category":"a"},{"category:"b"},{"category":"b"},{"category":"c"},{"category":"c"}]
Following is my View Class: from apps.embla_services.filters import RentPostFilters from django_filters import rest_framework as filters from apps.embla_service
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 am trying to implement permission checking mechanism in URLs for a request using wildcard techniques, rather than implement permission checking on each views.
I have this permission in Django that look like this: class PermissionName(BasePermission): def has_object_permission(self, request, view, obj):
Here is My Seller Model which has User as OneToOneField #models.py . . class CompanyProfile(models.Model): user = models.OneToOneField(User, on_delete=mode
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
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
I tried to solve the problem using this two methods from rest_framework.authtoken.models import Token admin.site.unregister(Token) ----- from rest_framework.aut
I want to rewrite the following API in a more efficient way using the serializer. In the following API, the user and group are foreign keys. I want to return al
I have to create a new Chat object using this view: class ChatListCreateView(ListCreateAPIView): permission_classes = [IsAuthenticated] serializer_class
I have created API for News model: models.py class News(models.Model): title = models.CharField(max_length=255) created_at = models.DateTimeField(auto_n
Hi I'm new to Django rest framework I have two models: class Location(models.Model): name = models.CharField(("name"), max_length=50) long = models.Char
I am having issue with my django server when trying to connect it to axios. It should be a simple fix but I am stuck! I am getting this error from my django ser