login
Persist a user id and a backend in the request. This way a user doesn't have to reauthenticate on every request. Note that data set during the anonymous session is retained when the user logs in.
def login(
request: HttpRequest,
user: User,
backend: str = None
) - > null
Persist a user id and a backend in the request. This way a user doesn't have to reauthenticate on every request. Note that data set during the anonymous session is retained when the user logs in.
Parameters
| Name | Type | Description |
|---|---|---|
| request | HttpRequest | The current web request object containing the session to be updated |
| user | User | The authenticated user instance to log into the current session |
| backend | str = None | The dotted import path of the authentication backend used to authenticate the user |
Returns
| Type | Description |
|---|---|
null | None |