Hi,
I'm using Token authentication with the post-save handler as suggested in the docs:
Specifically:
@receiver(post_save, sender=Customer)
def create_auth_token(sender, instance=None, created=False, **kwargs):
if created:
Token.objects.create(user=instance)
I've just enabled South in my app. However, it turns out that rest_framework.authtoken uses South migrations as well.
(As an aside - why is this? I could only see a single migration version anyhow, so not sure why we're using South here?)
When I run "syncdb" for the first time, it asks to create a Django superuser - however, this now fails, because the authtoken tables aren't created yet (since ./manage migrate now handles them):
DatabaseError: relation "authtoken_token" does not exist
LINE 1: INSERT INTO "authtoken_token" ("key", "user_id", "created") ...
Now, I can just not create the user within syncdb, and create it manually after I've run ./manage migrate.
However, I'm curious what's other people are doing? Is there a better or less manual workflow for handling this?
Cheers,
Victor