Top "Django-rest-framework" questions

A powerful and flexible toolkit for building RESTful Web APIs.

Django: TemplateDoesNotExist (rest_framework/api.html)

In my view function, I'd like to return a json object (data1) and some text/html (form). Is this possible? …

django django-views django-rest-framework
How to set current user to user field in Django Rest Framework?

I have the following code working perfectly. I can create a Post object from DRF panel by selecting an image …

django django-rest-framework
Django Rest framework, how to include '__all__' fields and a related field in ModelSerializer ?

I have two models, one with M2M relation and a related name. I want to include all fields in …

django django-models django-rest-framework
django-rest-framework 3.0 create or update in nested serializer

With django-rest-framework 3.0 and having these simple models: class Book(models.Model): title = models.CharField(max_length=50) class Page(models.Model): …

python json django serialization django-rest-framework
Django: Rest Framework authenticate header

Using Django REST API, I'm trying to authenticate my request. This is what I'm trying to send: Content-Type: application/json, …

django django-rest-framework
django rest framework filter

I'm working with API made from Django rest framework, I am trying to make a filter to a JSON This …

python django django-rest-framework django-filter
Django REST framework serializer without a model

I'm working on a couple endpoints which aggregate data. One of the endpoints will for example return an array of …

django django-rest-framework django-serializer
How can I define a list field in django rest framework?

Let's say I have a class class Tags(object): tags = [] def __init__(self, tags): self.tags = tags and a custom …

django json list field django-rest-framework
How do you return 404 when resource is not found in Django REST Framework

When a user inputs a url that is wrong, my Django app returns an HTML error. How can I get …

django django-rest-framework http-status-code-404
Editing django-rest-framework serializer object before save

I want to edit a django-rest-framwork serializer object before it is saved. This is how I currently do it - …

python django serialization django-rest-framework django-serializer