def get_context_data(self, **kwargs):
    context = super().get_context_data(**kwargs)
    (token, _) = Token.objects.get_or_create(user=self.request.user)
    context['token'] = token.key
    return context
def get_context_data(self, **kwargs):
    context = super().get_context_data(**kwargs)
    (token, _) = Token.objects.get_or_create(user=self.request.user)
    context['token'] = token.key
    return context