Top "Django-rest-framework" questions

A powerful and flexible toolkit for building RESTful Web APIs.

Add a non-model field on a ModelSerializer in DRF 3

How do add a non-model field on a ModelSerializer in DRF 3? i.e. add a field that does not exist …

python django django-rest-framework
How to PATCH a single field using Django Rest Framework?

I have a model 'MyModel' with many fields and I would like to update a field 'status' using PATCH method. …

python django api django-rest-framework http-patch
ModelSerializer using model property

I'm trying to serialize a model containing a property field that I also want to serialize. models.py: class MyModel(…

django-rest-framework
Django REST framework: AttributeError: Serializer object has no attribute 'Meta'

Given the following model and serializer for a Django REST framework setup: #!/usr/bin/env python # -*- coding: utf-8 …

python django django-rest-framework attributeerror
DRF: Simple foreign key assignment with nested serializers?

With Django REST Framework, a standard ModelSerializer will allow ForeignKey model relationships to be assigned or changed by POSTing an …

python django django-rest-framework
Using Django Rest Framework, how can I upload a file AND send a JSON payload?

I am trying to write a Django Rest Framework API handler that can receive a file as well as a …

json django rest django-rest-framework multipartform-data
Bad Django / uwsgi performance

I am running a django app with nginx & uwsgi. Here's how i run uwsgi: sudo uwsgi -b 25000 --chdir=/www/…

python django uwsgi django-rest-framework
Django Rest Framework writable nested serializers

I'm writing a recipe organizer as a sample project for a class. I'm not very experienced with DRF other than …

python django serialization django-rest-framework
Django REST Framework image upload

I have model Product: def productFile(instance, filename): return '/'.join( ['products', str(instance.id), filename] ) class Product(models.…

django image-upload django-rest-framework
Django Rest Framework - Get related model field in serializer

I'm trying to return a HttpResponse from Django Rest Framework including data from 2 linked models. The models are: class Wine(…

python django serialization foreign-keys django-rest-framework