title: "detail": "Method \"GET\" not allowed. on calling endpoint in django
body: <p>I'm using django.rest_framework. I have a get_or_create method for a particular view,</p>
  
  <pre><code>class LocationView(views.APIView):
      def get_or_create(self, request):
          try:
              location = Location.objects.get(country=request.data.get("country"), city=request.data.get("city"))
              Response(location, status=status.HTTP_200_OK)
          except Location.DoesNotExist:
              serializer = LocationSerializer(data=request.data)
              if serializer.is_valid():
                  serializer.save()
                  return Response(serializer.data, status=status.HTTP_201_CREATED)
              else:
                  Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
  </code></pre>
  
  <p>This is the location Model,</p>
  
  <pre><code>class Location(models.Model):
      country = models.CharField(max_length=255)
      city = models.CharField(max_length=255, unique=True)
      latitude = models.CharField(max_length=255)
      longitude = models.CharField(max_length=255)
  
      class Meta:
          unique_together = ('country', 'city')
  </code></pre>
  
  <p>This is my url,</p>
  
  <pre><code>url(r'^location/$', LocationView.as_view(), name='location'),
  </code></pre>
  
  <p>When I call this endpoint in the following way,
   <a href="http://127.0.0.1:8000/api/v1/bouncer/location/?country=USA&amp;&amp;city=Sunnyvale&amp;&amp;latitude=122.0363&amp;&amp;longitude=37.3688" rel="noreferrer">http://127.0.0.1:8000/api/v1/bouncer/location/?country=USA&amp;&amp;city=Sunnyvale&amp;&amp;latitude=122.0363&amp;&amp;longitude=37.3688</a></p>
  
  <p>This is what I get,</p>
  
  <pre><code>{
      "detail": "Method \"GET\" not allowed."
  }
  </code></pre>
  
  <p>What am I missing here.</p>