Skip to main content


REST API (also known as RESTful API) is also supported via django-rest-framework

Developers can quickly expose API to the frontend apps or mobile apps.

Consistent Signup, Login Behavior

The Signup, Login workflow are the same as the standard Django app. (django-allauth)

How to use the API

  1. Please check tests code under django_app/tests/unittest/users/api
  2. Or check the API Doc, you can find entry URL of the API doc in django_app/


By default, we use rest_framework.authtoken as our Token solution

Simple Example

# make sure the django dev server is running
$ python runserver
# run code below in the Django shell

import requests
from django.urls import reverse

# login to get the token
login_url = reverse("rest_login")
resp =
json={"username": "CHANGE-ME", "password": "CHANGE-ME"},

# if login succeed, get token from the response
data = resp.json()
token = data["key"]

# add token in the request header
detail_url = reverse("rest_user_details")
resp = requests.get(
headers={"Authorization": f"Token {token}"},

# you should see username, user_pk of the current login user

JWT Reference

You can also switch to JWT if you like

  1. JSON Web Token (JWT) Support
  2. Blacklist app
  3. Revoke JWT Refresh Token