Skip to content

DatabaseError: relation "authtoken_token" does not exist #705

Closed
@tobiasfuhlroth

Description

@tobiasfuhlroth

Versions:

  • Django==1.5
  • djangorestframework==2.2.2

INSTALLED_APPS:
'rest_framework',

I get the following DatabaseError when trying to delete a user (i use a custom user model) in Django Admin:
DatabaseError: relation "authtoken_token" does not exist
LINE 1: ..."."is_active", "accounts_user"."date_joined" FROM "authtoken...

Sqlite does not raise an error. Using the postgresql_psycopg2 backend does.

A quick search got me to the following issue http://stackoverflow.com/questions/15160315/how-to-disable-importing-authtoken-models-when-using-sessionauthentication-with that describes a similar behaviour.

Adding rest_framework.authtoken to INSTALLED_APPS and migrating to authtoken:0001_initial solved the problem for me, although i never intended to use rest_framework.authtoken.

I dont know yet what exactly is causing the problem, but maybe this information helps to narrow down the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions