Jump to >


Deprecated views for handling authentication.

These allow for logging a user in through an HTTP POST request supplying a username and password, and logging out through a POST or GET request.

This support is deprecated. Instead, your application should make use of one of our authentication backends, such as djblets.webapi.auth.backends.basic.WebAPIBasicAuthBackend.

account_login(request, *args, **kwargs)[source]

Log the user in through a provided login and password.

Rather than using this view, you should be authenticating using API auth backends instead.

Parameters:request (HttpRequest) – The HTTP request from the client.
Returns:A blank response if logging in succeeded, or a LOGIN_FAILED if it failed.
Return type:WebAPIResponseE
account_logout(request, *args, **kwargs)[source]

Log the user out, and send an API response.

Parameters:request (HttpRequest) – The HTTP request from the client.
Returns:The API response indicating a successful logout.
Return type:WebAPIResponse