def auth_token()

in nucleus/rna/views.py [0:0]


def auth_token(request):
    if request.user.is_active and request.user.is_staff:
        token, created = Token.objects.get_or_create(user=request.user)
        return HttpResponse(content=json.dumps({"token": token.key}), content_type="application/json")
    else:
        return HttpResponseForbidden()