Category "django-rest-framework"

Can't import rest_framework in Django

I'm trying to stand up a Django site and I am attempting to setup Report_builder with that. I just got the front end of report builder to work but it is not ret

I can't distinguish roles with my implementation in DRF+Angular

I've made an implementation of a login system using django as backend and angular as frontend. In the backend the authentication is implemented via the view ass

How to deal with model changes in Django Rest Framework?

This is not a question for a particular use case, but for something I noticed in my experience doing APIs, specifically with using Django and Django Rest Framew

last_login field is not updated when authenticating using Tokenauthentication in Django Rest Framework

I'm working in a project which relies in a Django User model and TokenAuthentication under DjangoRestFramework I was requested to get last login datetime for e

How to return an rest_framework.response object from a django custom middleware class?

I am trying to write a middleware class that ensures that the user is logged in. But the problem is this middleware class will only be applicable to a small set

Django Rest Framework Postman Token Authentication

I am using Django Rest Framework Token authentication and if i do curl http://localhost:8000/api/v1/users/?format=json -H 'Authorization: Token 0a813fdcd3f8846d

how to pass post parameter in Django rest swagger?

I have integrated swagger with django rest framework, but the swagger docs does not create a input box to post data for post request. I am using Function based

OperationalError, no such column. Django

I am very new to django and was able to finish the tutorial on djangoproject.com without any errors. I am now going through the Django REST framework tutorial f

Unable To Install Simple JWT in my Django Project

Here's my setup right now: Pip Freeze: asgiref==3.3.1 Django==3.0 djangorestframework==3.10.0 djangorestframework-simplejwt==4.6.0 PyJWT==2.0.1 pytz==2021.1 sql

Create a save data using Django post_save() Signal

Here I want to create a heatmap when a Lead is created, it'll create an example api for the particular API. This is my lead model and another model for the api,

Django REST Framework ModelSerializer get_or_create functionality

When I try to deserialize some data into an object, if I include a field that is unique and give it a value that is already assigned to an object in the databas

Pyinstaller and Django Rest

I am trying to use Pyinstaller with django rest, it generates the .exe well but there is an error at the moment of executing the .exe, the error is this Module

Django Rest Framework - prevent access to API?

I'm using Django Rest Framework and Token Authentication. Everything works great so far. http://www.django-rest-framework.org/api-guide/authentication#tokenaut

How REST API handle continuous data update

I have REST backend api, and front end will call api to get data. I was wondering how REST api handles continuous data update, for example, in jenkins, we wil

Pass extra arguments to Serializer Class in Django Rest Framework

I want to pass some arguments to DRF Serializer class from Viewset, so for I have tried this: class OneZeroSerializer(rest_serializer.ModelSerializer): de

How to use swagger_auto_schema in a class based view with no serializer_class and how to add custom authentication permission to it?

I have a class based view as: class ClassBasedView(GenericAPIView): @swagger_auto_schema(responses={201: 'Created'}) @authorize(myCustomPermission)

CSRF validation does not work on Django using HTTPS

I am developing an application which the frontend is an AngularJS API that makes requests to the backend API developed in Django Rest Framework. The frontend

TypeError: __init__() got an unexpected keyword argument 'many'

While trying to return a query-set using generic views, I get an error TypeError: init() got an unexpected keyword argument 'many' I am unable to underst

How can I show the StringRelatedField instead of the Primary Key while still being able to write-to that field using Django Rest Framework?

Models: class CrewMember(models.Model): DEPARTMENT_CHOICES = [ ("deck", "Deck"), ("engineering", "Engineering"), ("interior", "Inte

How can I show the StringRelatedField instead of the Primary Key while still being able to write-to that field using Django Rest Framework?

Models: class CrewMember(models.Model): DEPARTMENT_CHOICES = [ ("deck", "Deck"), ("engineering", "Engineering"), ("interior", "Inte