Is it possible for django-rest-framework view to be called without a request object?
<p>I've inherited a Django code base using Django REST Framework that has many views that check for the existence of a <code>request</code> argument at the top, like this:</p>

<pre><code>class ExampleViewSet(viewsets.GenericViewSet):
    def create(self, request):
        if not request:
            return Response(status=404)
</code></pre>

<p>This doesn't seem logical to me as I don't understand how the method can be called without a request object.  I'm inclined to remove it since I haven't been able to find any documentation of this idiom.  Is there some purpose I'm missing?</p>

<p>They are required. This is how <a href="https://docs.djangoproject.com/en/1.10/topics/http/urls/#how-django-processes-a-request" rel="nofollow">Django processes the urls</a>.
You'll likely have an issue if you remove it as other part of the code expects this argument.</p>

python django django-rest-framework