title: Why is my form not retrieving any data in django
body: <p>I am trying to combine two input json data for a class based django rest framework view.<br>
  I am feeding in data in this format</p>
  
  <pre><code>{
      "profile": {
          "phone": "9841101115",
          "email": "nirjalpaudl543sddsd12@gmail.com",
          "bio": "I am the admin of the site",
          "status": "AWY",
          "address": "Pepsicola, Kathmandu"
      },
      "user": {
          "username": "sampanna12",
          "password1": "test12345",
          "password2": "test12345"
      }
  }
  </code></pre>
  
  <p>The error shown suggests that data was never retrieved by the serializers. The response i get is</p>
  
  <pre><code>{
      "Error": "Something went wrong while making a user",
      "message": {
          "username": [
              "This field is required."
          ],
          "password1": [
              "This field is required."
          ],
          "password2": [
              "This field is required."
          ]
      }
  }
  </code></pre>
  
  <p>My post view is getting the data but my form is not getting as suggested by the response
  <a href="https://i.stack.imgur.com/55T17.png" rel="nofollow noreferrer">enter image description here</a>
  My models.py looks like </p>
  
  <pre class="lang-py prettyprint-override"><code>from django.db import models
  from django.contrib.auth.models import User
  
  # Create your models here.
  class Profile(models.Model):
      user         = models.OneToOneField(User,on_delete=models.CASCADE,related_name="profile_user")
      email        = models.EmailField(max_length=50,blank=False,unique=True)
      bio          = models.TextField(verbose_name="Describe Yourself")
      statustypes  =  (
                          ("LFJ","Looking for job"),
                          ("CAJ","Creating a job"),
                          ("AWY","Away for somtime"),
                      )
      status       = models.CharField(choices=statustypes,max_length=3,blank=False)
      phone        = models.CharField(max_length=15,unique=True)
      address      = models.CharField(max_length=40,)
      #cv          = models.OneToOneField(CV,on_delete=models.CASCADE)
      #pp           = models.ImageField(verbos_name="Profile Picture",upload_to="profile pictures")
  
      def __str__(self):
          return self.user.username
  </code></pre>
  
  <p>My serializer.py looks like </p>
  
  <pre class="lang-py prettyprint-override"><code>from rest_framework import serializers 
  from django.contrib.auth.models import User
  from . import models 
  
  class UserSerializer(serializers.ModelSerializer): 
      password1=serializers.CharField(
          write_only=True,
          min_length=8,
          required=True,
          style={
              "input_type":"password"
          }
      )
  
      password2=serializers.CharField(
          write_only=True,
          min_length=8,
          required=True,
          style={
              "input_type":"password"
          }
      )
      class Meta:
          model=User
          fields=["username","password1","password2"]    
  
  
  
  class ProfileSerializer(serializers.ModelSerializer):
      user=UserSerializer()
      class Meta:
          model=models.Profile
          fields=['phone','email','bio','status','address','user']
  
  </code></pre>
  
  <p>My views.py looks like </p>
  
  <pre class="lang-py prettyprint-override"><code>from django.shortcuts import render
  from rest_framework.decorators import APIView
  from django.contrib.auth.models import User
  from rest_framework.response import Response
  
  from . import serializers,models
  # Create your views here.
  
  class UserApi(APIView):
      def get(self,request, format=None):
          allusers=models.Profile.objects.all()
          print(allusers)
          data=serializers.ProfileSerializer(allusers,many=True)
          return Response(data.data)
  
      def post(self,request, format=None):
          data=request.data
          print(data.get("user"))
          print(data.get("profile"))
          sampleprofile=serializers.ProfileSerializer( data=data.get("user") )
          sampleuser=serializers.UserSerializer( data=data.get("profile") )
          if sampleuser.is_valid():
              currentuser=sampleuser.create()
          else:
              return Response({
                      "Error":"Something went wrong while making a user",
                      "message":sampleuser.errors,
                  })
  
          sampleprofile.user=sampleuser
  
          if sampleprofile.is_valid():
              sampleprofile.create()
          else:
              return Response({
                      "Error":"Something went wrong while making profile",
                      "message":sampleprofile.errors,
                  })
  
  
  </code></pre>