Hi all,
I have encountered a problem when trying to create views that have to include the same string in name. I created two views below.
The problem is here, when I tried to make a post request to revoke_token endpoint, this request always is handled by 'token/' endpoint(TokenView). I debugged url Django resolver, as far as I understood, Django always check include a string in the path, not an exact match. When it sees "token/" words in "token/" URL, it says I found the URL path and return TokenView as a handler. When I swap these two URL paths, it works well.
Is there anyone faced with this problem? Thanks in advance.
url("token/", TokenView.as_view(), name="token"),
url("revoke_token/", RevokeTokenView.as_view(), name="revoke-token"),