Category "django-rest-framework"

Django and Axios Forbidden (CSRF token missing or incorrect.)

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

Django cache real-time data with DRF filtering and sorting

I'm building a web app to manage a fleet of moving vehicles. Each vehicle has a set of fixed data (like their license plate), and another set of data that gets

Django Rest-Framework search-fields wont work inside @action

I'm trying to use the search field offered by DRF inside of an action, but it seems to not work. I had a similar problem paginating inside of the action but fou

django_elasticsearch_dsl -RequestError(400, 'search_phase_execution_exception', 'failed to create query: For input string: )

I am trying to search with Elasticsearch using django_elasticsearch_dsl and 'django_elasticsearch_dsl_drf',, but I get RequestError(400, 'search_phase_execution

Stuck in urls.py while migrating a website from Python 2 to Python 3

urlpatterns = format_suffix_patterns(urlpatterns, allowed=['json', 'html']) While running manage.py makemigrations, got this error and was stuck in this error

Is REST framework token authentication safe?

I am relatively new to REST Framework for django. I was creating a simple app to login the users and I tried using Token Authentication. My concern is the token

I'm trying to return mutliply queryset

I have endpoin called groups I want to return to each user groups that he created and the groups that he member in it my model class Group(models.Model): ti

difference between django and django rest framework

Okay I just finished a YouTube course on Django tutorials and i more or less understand Django to an extent. Now the issue is Django rest framework. Google says

'cryptography' package is required for sha256_password or caching_sha2_password auth methods

Request Method: POST Request URL: http://192.168.0.110/admin/login/?next=/admin/ Django Version: 4.0.1 Exception Type: RuntimeError Exception Value: 'cryptog

drf - trailing / in url throwing error while calling post api

views.py class FurnitureViewSet(mixins.ListModelMixin, mixins.RetrieveModelMixin, GenericViewSet): permission_classes = [AllowAny] serializer_class = Fu

Django rest framework using Template to send an e-mail

I want to send a styled email using HTML tags. The mail is sent successfully but without style and the HTML tags are presented as a text in the email. handles.p

drf - remove miliseconds from serializers.DateTimeField when sending response

I have to write a serializer that returns datetime in the following formats: 2012-01-01T13:00:00+00:00 (utc_with_timezone) 2020-01-01T09:00:00 (must be in local

HTTP PATCH to check if handler is available

Can I use HTTP PATCH on endpoint /users to check if some handler is available?

Group base permission rest api in Django

i am using Django rest framework for my login api. Now i want to login only certain group user through api. I have created group and assigned user to the group.

DRF Serializer Fields are not showing in Openapi Schemas

I set up openapi with the drf-yasg package for my DRF API but for some reason, all endpoints for POST or PUT in my documentation are not showing the necessary f

Django PDF parser on POST request

I hope for your help. Because I have been struggling with this problem for a long time. A POST request comes from the frontend with one PDF file, after which I

Need to override save method for image field and save it as base64 string using django

models.py class Organisation(models.Model): org_id = models.CharField(max_length=50,default=uuid.uuid4, editable=False, unique=True, primary_key=True)

xml attributes instead child elements

Using djangorestframework-xml, can someone please help me how to render child elements as attributes? Following the example below <CreateCustomerAndMortgage&

The new url id is getting appended after the previous request's url

I'm making a get request in django using html form as: crud.html <form action="{% url 'crudId' id %}" method="get"> <div class="col">

How can I get 'sign in with Google' to work using 'dj_rest_auth'?

I'm trying to implement Google sign in using DRF and dj_rest_auth. I've set up 'django-allauth' with Google as provider and the sign in process works in the web