Migrating from 1.x to 2.0¶
Here are some advices to help you with the transition to new Djoser.
- If you still use Python 2.x - stay on Djoser 1.x.
- If you still use Django REST Framework 3.9 or lower - stay on Djoser 1.x.
- There were several changes to default settings
- User-related endpoints are gathered within UserViewSet.
Some View class names and URLs has been updated or removed¶
View class names:
RootViewhas been removed
ResendActivationViewhave all been removed and replaced by appropriate sub-views within
If you subclassed any of those views, you need to refactor your code - we suggest subclassing UserViewSet and overwrite appropriate methods there.
users/resend/removed; use viewset-provided endpoints (see settings)
password/has been renamed to
password/reset/has been renamed to
password/reset/confirm/has been renamed to
Token Based Authentication URLs:
token/loginto create token
token/logoutto invalidate the token
If anything else stopped working: consult settings first before filing a bug report.