get_user
Returns the user model instance associated with the given request, caching the result on the request object to prevent redundant authentication lookups.
def get_user(
request: HttpRequest
) - > User
Retrieves the user object associated with the given request, utilizing an internal cache to avoid redundant authentication lookups.
Parameters
| Name | Type | Description |
|---|---|---|
| request | HttpRequest | The incoming HTTP request object used to retrieve or store the cached user instance. |
Returns
| Type | Description |
|---|---|
User | The authenticated user instance associated with the current request. |