mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-01-24 08:14:16 +03:00
Add full required imports to Generating Tokens example
Previously we were missing User and post_save.
This commit is contained in:
parent
d3440f0311
commit
5acefd3b17
|
@ -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.
|
||||
|
||||
from django.contrib.auth.models import User
|
||||
from django.db.models.signals import post_save
|
||||
from django.dispatch import receiver
|
||||
from rest_framework.authtoken.models import Token
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user