Django Rest source framework APIView call

  Previous say the process requesting access, this one say about the request to call the corresponding source code

  • as_view
    • Defined view
    • dispatch
  • dispatch
    • initialize_request  
      • get_parsers (get parser)
      • parser_context (analytical context)
      • get_authentitors (get authenticator)
      • get_context_negotiator (get the context content)
    • default_response_headers
    • initial
      • get_format_suffix
        • kwargs acquired on
        • key is configured FORMAT_SUFFIX_KWARG settings
      • perform_content_negotiation
        • get_renderers
        • get_content_negotiator
      • determine_version
        • versioning_class
      • perform_authentication
        • request.user
        • user is a property modification function uses
          • Get request._user
          • Perform the authentication process property does not exist
          • Convenience authenticator
          • Call authenticator method authenticate
          • If authentication is successful will return a Ganso (user, auth), user and auth will be saved to the request
          • If the authentication is abnormal or authentication is not all succeed, or go directly to _not_authenticated
        • get_authenticators obtained authenticator
      • check_permissions
        • get_permissions
        • Iteration
        • If you do not have permission, will permission_denied
          • Direct throw an exception, so the program is terminated
        • What considered a privilege
          • All the devices have no rights to return, has_permission return true
      • check_throttles
        • get_throttles
        • Since throttling method will allow_request
          • True to allow representatives return
          • Representatives do not allow returns False
            • We will not allow Throttled
            • It is Throws

Guess you like

Origin www.cnblogs.com/wuygblog/p/10994473.html