mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-02-26 16:30:41 +03:00
1.2 KiB
1.2 KiB
Views
REST framework provides a simple View
class, built on Django's django.generics.views.View
. The View
class ensures five main things:
- Any requests inside the view will become
Request
instances. Request
instances will have theirrenderers
andauthentication
attributes automatically set.Response
instances will have theirparsers
andserializer
attributes automatically set.ImmediateResponse
exceptions will be caught and returned as regular responses.- Any permissions provided will be checked prior to passing the request to a handler method.
Additionally there are a some minor extras, such as providing a default options
handler, setting some common headers on the response prior to return, and providing the useful initial()
and final()
hooks.