Commit 5acefd3b by OddBloke

Add full required imports to Generating Tokens example

Previously we were missing User and post_save.
parent d3440f03
...@@ -162,6 +162,8 @@ The `curl` command line tool may be useful for testing token authenticated APIs. ...@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment