... | ... | @@ -48,7 +48,7 @@ users-details |
|
|
|
|
|
The views even they could be managed by standard views defined as functions, it is highly advised to use class-based views instead because it means you can use pre-defined DRF's views objects as a base and not care about multiple points that are automated as soon as your view is subclassing `rest_framework.views.APIView` or one of its subclass:
|
|
|
* The `view.as_view()` method provides a view adapted for the API (CSRF exempted, ...)
|
|
|
* The handling of [authentication](the-authentication-classes), HTTP methods authorized and [permissions](the-permission-classes) are automatically done under the hood and the code left is smaller and simpler to understand.
|
|
|
* The handling of [authentication](#the-authentication-classes), HTTP methods authorized and [permissions](#the-permission-classes) are automatically done under the hood and the code left is smaller and simpler to understand.
|
|
|
|
|
|
To use the most basic class-based view, use the following structure:
|
|
|
```python
|
... | ... | |