Runs anything that needs to occur prior to calling the method handler.
(self, request, *args, **kwargs)
| 403 | ) |
| 404 | |
| 405 | def initial(self, request, *args, **kwargs): |
| 406 | """ |
| 407 | Runs anything that needs to occur prior to calling the method handler. |
| 408 | """ |
| 409 | self.format_kwarg = self.get_format_suffix(**kwargs) |
| 410 | |
| 411 | # Perform content negotiation and store the accepted info on the request |
| 412 | neg = self.perform_content_negotiation(request) |
| 413 | request.accepted_renderer, request.accepted_media_type = neg |
| 414 | |
| 415 | # Determine the API version, if versioning is in use. |
| 416 | version, scheme = self.determine_version(request, *args, **kwargs) |
| 417 | request.version, request.versioning_scheme = version, scheme |
| 418 | |
| 419 | # Ensure that the incoming request is permitted |
| 420 | self.perform_authentication(request) |
| 421 | self.check_permissions(request) |
| 422 | self.check_throttles(request) |
| 423 | |
| 424 | def finalize_response(self, request, response, *args, **kwargs): |
| 425 | """ |