From f010240d0431d4d2b8808668941dbbe3366bb260 Mon Sep 17 00:00:00 2001 From: danillab <2811802+danillab@users.noreply.github.com> Date: Mon, 15 Apr 2019 11:41:33 +0700 Subject: [PATCH] change User to get_user_model() --- docs/api-guide/authentication.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/api-guide/authentication.md b/docs/api-guide/authentication.md index 5b8a9844f..ccb843aac 100644 --- a/docs/api-guide/authentication.md +++ b/docs/api-guide/authentication.md @@ -184,10 +184,10 @@ Note that you'll want to ensure you place this code snippet in an installed `mod If you've already created some users, you can generate tokens for all existing users like this: - from django.contrib.auth.models import User + from django.contrib.auth import get_user_model from rest_framework.authtoken.models import Token - for user in User.objects.all(): + for user in get_user_model().objects.all(): Token.objects.get_or_create(user=user) ##### By exposing an api endpoint