How to activate after click on the link send by djoser? my settings '''
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'djoser',
'rest_framework',
'rest_framework_simplejwt',
'data',
]
REST_FRAMEWORK = {
'DEFAULT_AUTHENTICATION_CLASSES':(
'rest_framework_simplejwt.authentication.JWTAuthentication',
'rest_framework.authentication.SessionAuthentication',
),
}
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_USE_TLS = True
EMAIL_HOST_USER = '[email protected]'
EMAIL_HOST_PASSWORD='naz@technomancer7629'
EMAIL_PORT = 587
PROTOCOL = "http"
DOMAIN = "127.0.0.1:8000"
DJOSER = {
'PASSWORD_RESET_CONFIRM_URL': '/password/reset/confirm/{uid}/{token}',
'USERNAME_RESET_CONFIRM_URL': '/username/reset/confirm/{uid}/{token}',
'ACTIVATION_URL': 'auth/user/activate/{uid}/{token}',
'SEND_ACTIVATION_EMAIL': True,
'SEND_CONFRIMATION_EMAIL':True,
'SERIALIZERS': {},
'EMAIL':{
'activation': 'djoser.email.ActivationEmail',
},
}
''' urls.py '''
urlpatterns = [
path('admin/', admin.site.urls),
path('auth/',include('djoser.urls')),
path('auth/',include('djoser.urls.jwt')),
path("api/data/",include("data.urls")),
]
''' my email link http://127.0.0.1:8000/auth/users/activate/Mjc/5bx-5f9542251fd9db7e980b error:
Using the URLconf defined in startgo1.urls, Django tried these URL patterns, in this order:
admin/
auth/ ^users/$ [name='user-list']
auth/ ^users\.(?P<format>[a-z0-9]+)/?$ [name='user-list']
auth/ ^users/activation/$ [name='user-activation']
auth/ ^users/activation\.(?P<format>[a-z0-9]+)/?$ [name='user-activation']
auth/ ^users/me/$ [name='user-me']
auth/ ^users/me\.(?P<format>[a-z0-9]+)/?$ [name='user-me']
auth/ ^users/resend_activation/$ [name='user-resend-activation']
auth/ ^users/resend_activation\.(?P<format>[a-z0-9]+)/?$ [name='user-resend-activation']
auth/ ^users/reset_password/$ [name='user-reset-password']
auth/ ^users/reset_password\.(?P<format>[a-z0-9]+)/?$ [name='user-reset-password']
auth/ ^users/reset_password_confirm/$ [name='user-reset-password-confirm']
auth/ ^users/reset_password_confirm\.(?P<format>[a-z0-9]+)/?$ [name='user-reset-password-confirm']
auth/ ^users/reset_username/$ [name='user-reset-username']
auth/ ^users/reset_username\.(?P<format>[a-z0-9]+)/?$ [name='user-reset-username']
auth/ ^users/reset_username_confirm/$ [name='user-reset-username-confirm']
auth/ ^users/reset_username_confirm\.(?P<format>[a-z0-9]+)/?$ [name='user-reset-username-confirm']
auth/ ^users/set_password/$ [name='user-set-password']
auth/ ^users/set_password\.(?P<format>[a-z0-9]+)/?$ [name='user-set-password']
auth/ ^users/set_username/$ [name='user-set-username']
auth/ ^users/set_username\.(?P<format>[a-z0-9]+)/?$ [name='user-set-username']
auth/ ^users/(?P<pk>[^/.]+)/$ [name='user-detail']
auth/ ^users/(?P<pk>[^/.]+)\.(?P<format>[a-z0-9]+)/?$ [name='user-detail']
auth/ ^$ [name='api-root']
auth/ ^\.(?P<format>[a-z0-9]+)/?$ [name='api-root']
auth/ ^jwt/create/? [name='jwt-create']
auth/ ^jwt/refresh/? [name='jwt-refresh']
auth/ ^jwt/verify/? [name='jwt-verify']
api/data/
The current path, auth/users/activate/Mjc/5bx-5f9542251fd9db7e980b, didn't match any of these.
users/activation/
and notusers/activate/
to the email link? – Linh Nguyen