Top "Django-rest-framework" questions

A powerful and flexible toolkit for building RESTful Web APIs.

Django rest framework, use different serializers in the same ModelViewSet

I would like to provide two different serializers and yet be able to benefit from all the facilities of ModelViewSet: …

django serialization django-rest-framework
405 POST method not allowed

I'm trying to develop a REST provider with OAuth. I'm using Django RESTFramework and DjangoOAuthToolkit. I did a GET and …

django post oauth django-rest-framework http-status-code-405
CSRF Failed: CSRF token missing or incorrect

I'm using Django 1.7 and django-rest-framework. I made an API that returns me some JSON data putting this in my settings.…

django django-rest-framework
django.db.migrations.exceptions.InconsistentMigrationHistory

When I run python manage.py migrate on my Django project, I get the following error: Traceback (most recent call …

python django django-models django-rest-framework database-migration
Django Rest Framework - How to add custom field in ModelSerializer

I created a ModelSerializer and want to add a custom field which is not part of my model. I found …

python django django-rest-framework
How do I create a login API using Django Rest Framework?

I want to create a login api (or use an existing one if it is already pre-bundled) using django rest …

python django rest django-rest-framework
RuntimeError: Model class django.contrib.sites.models.Site doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS

I am building an application with Django Rest Framework and AngularJs. I am using Django-rest-auth for my authentication purposes, although, …

django django-rest-framework django-rest-auth
How do I include related model fields using Django Rest Framework?

Let's say that we have the following model: class Classroom(models.Model): room_number = [....] class Teacher(models.Model): name = [...] tenure = [...] …

python django django-rest-framework
How to make a POST simple JSON using Django REST Framework? CSRF token missing or incorrect

Would appreciate someone showing me how to make a simple POST request using JSON with Django REST framework. I do …

django json post django-rest-framework
ForeignKey does not allow null values

I am using the Django REST Framework 2.0. Here is my model class: class Mission(models.Model): assigned_to = models.ForeignKey(…

django-rest-framework model foreign-keys serialization