1
votes

I'm using Django and djoser as backend for a mobile app.

When I make following POST request:

curl -X POST http://127.0.0.1:8000/auth/users/ --data 'username=myusername&email=myemail&password=mypwd'

I receive an email to myemail with the activation link with the proper uid and token.

Then I try to activate the user by doing:

curl -X POST http://127.0.0.1/auth/users/activation/ --data 'uid=myuid&token=mytoken'

After this I get a 404 NOT FOUND response. Djoser documentation says the activation endpoint is /users/activation/.

My urls.py is as follows:

from django.contrib import admin
from django.urls import include, path, re_path


urlpatterns = [
    path('admin/', admin.site.urls),
    path('api/v1/', include('api.urls')),
    re_path(r'^auth/', include('djoser.urls')),
]

Does anybody know what I'm doing wrong?

Thank you so much for your support!

1

1 Answers

1
votes

I already found my mistake, it is so silly. I come back here just for the record.

curl -X POST http://127.0.0.1/auth/users/activation/ --data 'uid=myuid&token=mytoken'

The URL used for the activation was not specifing the PORT.

It should be like as follows(in my case):

curl -X POST http://127.0.0.1:8000/auth/users/activation/ --data 'uid=myuid&token=mytoken'