title: Django Rest and Axios
body: <p>I am trying to post data using DRF and Axios. I have tried a couple different options so far with the same result, 403 (Forbidden). I am able to get data using axios.get but not able to post data. I am new to rest and using ajax so I apologize if it is something obvious. </p>
  
  <h1>Axios call</h1>
  
  <pre><code>return axios({
                  method: 'post',
                  url: "/schedules/",
                  data: {
                      "emp": this.emp.emp,
                      'start_time': this.startTime,
                      "end_time": this.endTime,
                      "date": this.today,
                      "location": this.location
                  },
                  xsrfHeaderName: "X-CSRFToken",
                  responseType: 'json'
                })
  </code></pre>
  
  <h1>Settings.py</h1>
  
  <pre><code>CSRF_COOKIE_NAME = "XSRF-TOKEN"
  </code></pre>
  
  <h1>Serializer</h1>
  
  <pre><code>class SchedSerializer(serializers.ModelSerializer):
  
      class Meta:
          model = Schedule
          fields = (
              'location',
              'emp',
              'date',
              'start_time',
              'end_time'
          )
  </code></pre>
  
  <h1>View</h1>
  
  <pre><code>class SchedViewSet(viewsets.ModelViewSet):
      queryset = Schedule.objects.all()
      serializer_class = serializers.SchedSerializer
  </code></pre>