title: (Django )Django Restful Framework autocomplete search bar
body: <p>I'm trying to create a simple HTML search input based from rest framework API JSON file. so far I manage to GET the data from the JSON file. In console log the data i wanted is there but when I search for it in the search field it gives me this error :</p>
  
  <pre><code>GET http://127.0.0.1:8000/nameList?term=a 404 (Not Found)
  </code></pre>
  
  <p>I try to convert it into string but still no different.</p>
  
  <p>Here's my code :
  HTML</p>
  
  <pre><code>&lt;html lang="en"&gt;
  &lt;head&gt;
      &lt;meta charset="UTF-8"&gt;
      &lt;title&gt;Title&lt;/title&gt;
      &lt;script src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"&gt;&lt;/script&gt;
      &lt;script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js" integrity="sha256-VazP97ZCwtekAsvgPBSUwPFKdrwD3unUfSGVYrahUqU=" crossorigin="anonymous"&gt;&lt;/script&gt;
  
  &lt;/head&gt;
  &lt;body&gt;
  &lt;br&gt;
  &lt;input id="name_search_tags" type="text" placeholder="Search..."&gt;
  &lt;/body&gt;
  &lt;script&gt;
      $.getJSON("list/?format=json", function (json) {
      console.log(json);
  
      $.each(json, function(key, val) {
          var nameList = [];
          var employee_name = val.employee_name;
          nameList.push(employee_name.toUpperCase());
          var string = nameList.toString();
          console.log(employee_name);
          console.log(nameList);
      });
      $("#name_search_tags").autocomplete({source: 'nameList'});
  });
  &lt;/script&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>model.py</p>
  
  <pre><code>from django.db import models
  
  # Create your models here.
  
  
  class MyModel(models.Model):
      employee_name = models.CharField(max_length=100)
  
      def __str__(self):
          return self.employee_name
  </code></pre>
  
  <p>serializer.py</p>
  
  <pre><code>from  rest_framework import serializers
  from .models import *
  
  
  class MyModelSerializer(serializers.ModelSerializer):
  
      class Meta:
          model = MyModel
          #fields = ('field 1','field 2')
          fields = '__all__'
  </code></pre>
  
  <p>view.py</p>
  
  <pre><code>from django.shortcuts import render
  from .models import *
  from .forms import *
  from rest_framework.views import APIView
  from rest_framework.response import Response
  from rest_framework import status
  from .serializers import *
  
  
      class MyModelList(APIView):
          def get(self, request):
                          #get all objects in model
              modelList = MyModel.objects.all()
              #convert to JSON                          #multiple objects in model
              serializers = MyModelSerializer(modelList, many=True)
              #return the serialize JSON data
              return Response(serializers.data)
  </code></pre>
  
  <p>url.py</p>
  
  <pre><code>from django.conf.urls import url
  from django.contrib import admin
  from search.views import *
  from rest_framework.urlpatterns import format_suffix_patterns
  
  
  urlpatterns = [
      url(r'^admin/', admin.site.urls),
      url(r'^$', search, name='search'),
      url(r'^list/', MyModelList.as_view(), name='list_view'),
  ]
  
  urlpatterns = format_suffix_patterns(urlpatterns)
  </code></pre>
  
  <p>JSON</p>
  
  <pre><code>[
      {
          "id": 1,
          "employee_name": "Rajiv"
      },
      {
          "id": 2,
          "employee_name": "Izzat"
      },
      {
          "id": 3,
          "employee_name": "Nagendra"
      },
      {
          "id": 4,
          "employee_name": "Shawn"
      },
      {
          "id": 5,
          "employee_name": "Jason"
      }
  ]
  </code></pre>
  
  <p>I appreciate everyone help. Thanks</p>