Add full required imports to Generating Tokens example

Previously we were missing User and post_save.
This commit is contained in:
OddBloke 2013-12-11 13:55:54 +00:00
parent d3440f0311
commit 5acefd3b17

View File

@ -162,6 +162,8 @@ The `curl` command line tool may be useful for testing token authenticated APIs.
If you want every user to have an automatically generated Token, you can simply catch the User's `post_save` signal. If you want every user to have an automatically generated Token, you can simply catch the User's `post_save` signal.
from django.contrib.auth.models import User
from django.db.models.signals import post_save
from django.dispatch import receiver from django.dispatch import receiver
from rest_framework.authtoken.models import Token from rest_framework.authtoken.models import Token