BackendAuthentication
User Endpoints (Djoser)
Registration, activation, password management via djoser REST endpoints.
All djoser endpoints are mounted under /auth/. The configuration is in config/settings/base.py under DJOSER.
Registration
Create User
POST /auth/users/{
"email": "user@example.com",
"password": "secure-password-123",
"re_password": "secure-password-123"
}Returns 201 Created. If SEND_CONFIRMATION_EMAIL is enabled, an activation email is sent.
Activate Account
POST /auth/users/activation/{
"uid": "MQ",
"token": "c3g3vj-abc123..."
}The uid and token come from the activation email link.
Resend Activation Email
POST /auth/users/resend_activation/{
"email": "user@example.com"
}Current User
Get Profile
GET /auth/users/me/Returns the authenticated user's data including id, email, name.
Update Profile
PUT /auth/users/me/
PATCH /auth/users/me/Delete Account
DELETE /auth/users/me/{
"current_password": "your-password"
}Password Management
Change Password
POST /auth/users/set_password/{
"new_password": "new-secure-password",
"re_new_password": "new-secure-password",
"current_password": "old-password"
}Request Password Reset
POST /auth/users/reset_password/{
"email": "user@example.com"
}Sends a password reset email with uid and token.
Confirm Password Reset
POST /auth/users/reset_password_confirm/{
"uid": "MQ",
"token": "c3g3vj-abc123...",
"new_password": "new-secure-password",
"re_new_password": "new-secure-password"
}Email Management
Change Email
POST /auth/users/set_email/{
"new_email": "newemail@example.com",
"re_new_email": "newemail@example.com",
"current_password": "your-password"
}Djoser Configuration
DJOSER = {
"USER_CREATE_PASSWORD_RETYPE": True,
"SEND_CONFIRMATION_EMAIL": True,
"PASSWORD_RESET_CONFIRM_URL": "auth/password/reset/{uid}/{token}",
"ACTIVATION_URL": "auth/activate/{uid}/{token}",
"SERIALIZERS": {
"user_create": "backend.users.api.serializers.UserSerializer",
"user": "backend.users.api.serializers.UserSerializer",
"current_user": "backend.users.api.serializers.UserSerializer",
},
}