Django REST Framework token authentication vs. django-telegram-bot clash
scorchio opened this issue · 2 comments
scorchio commented
Hi,
I have a Django setup where I'm trying to provide an API and use it as a Telegram bot at the same time. (Not the best setup I know, but I wanted a light setup, possibly refactoring the bot into a separate service later when it's really necessary.)
I wanted to enable support for Django REST Framework's token authentication after I got started with django-telegram-bot. When I run python manage.py migrate
, it fails and gives me this:
SystemCheckError: System check identified some issues:
ERRORS:
authtoken.Token.user: (fields.E304) Reverse accessor for 'Token.user' clashes with reverse accessor for 'AuthToken.user'.
HINT: Add or change a related_name argument to the definition for 'Token.user' or 'AuthToken.user'.
authtoken.Token.user: (fields.E305) Reverse query name for 'Token.user' clashes with reverse query name for 'AuthToken.user'.
HINT: Add or change a related_name argument to the definition for 'Token.user' or 'AuthToken.user'.
telegrambot.AuthToken.user: (fields.E304) Reverse accessor for 'AuthToken.user' clashes with reverse accessor for 'Token.user'.
HINT: Add or change a related_name argument to the definition for 'AuthToken.user' or 'Token.user'.
telegrambot.AuthToken.user: (fields.E305) Reverse query name for 'AuthToken.user' clashes with reverse query name for 'Token.user'.
HINT: Add or change a related_name argument to the definition for 'AuthToken.user' or 'Token.user'.
Is there a workaround for this?