how to expose your login and logout as api in django code example Example: django import user from django.contrib.auth.models import User