Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/3.0.0 #820

Draft
wants to merge 24 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
c293f47
v3 branch init
tomwojcik May 3, 2024
46d1fd5
extract new UserViewSet without any actions
tomwojcik May 4, 2024
29aead3
drop router from the new UserViewSet in urls
tomwojcik May 4, 2024
872e7c2
extract me viewset
tomwojcik May 4, 2024
6272357
move the remaining actions out of the old UserViewSet, drop the old U…
tomwojcik May 4, 2024
0ef9f51
rm the old viewset from tests
tomwojcik May 4, 2024
3c4b26c
align UserViewSet get_serializer_class
tomwojcik May 4, 2024
96d1ccf
fix copy-pasted incorrect set username viewset when refactoring
tomwojcik May 4, 2024
dbf874b
fix tests, drop unused mocks
tomwojcik May 4, 2024
c272a8a
Merge branch 'refs/heads/master' into release/3.0.0
tomwojcik Nov 10, 2024
26a5383
rm empty views
tomwojcik Nov 10, 2024
e20dc24
activation
tomwojcik Nov 10, 2024
988d1c7
Merge branch 'master' into release/3.0.0
tomwojcik Nov 10, 2024
d6a3421
Merge remote-tracking branch 'origin/release/3.0.0' into release/3.0.0
tomwojcik Nov 10, 2024
f100b22
Merge branch 'refs/heads/master' into release/3.0.0
tomwojcik Nov 10, 2024
df5520c
updated views
tomwojcik Nov 10, 2024
00065da
updated urls
tomwojcik Nov 10, 2024
954390b
mv
tomwojcik Nov 10, 2024
c88b7c1
align some tests
tomwojcik Nov 10, 2024
44ea180
mv re_path to path in jwt and auth token
tomwojcik Nov 10, 2024
e162b21
Merge branch 'master' into release/3.0.0
Mar 3, 2025
8482713
Merge branch 'master' into release/3.0.0
Mar 3, 2025
ed6037b
rm useless pytest.ini and python_paths that doesn't work
Mar 3, 2025
3b53f50
add new granular views
Mar 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions djoser/urls/authtoken.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from django.urls import re_path

from djoser import views
from djoser.views.token.create import TokenCreateView
from djoser.views.token.destroy import TokenDestroyView

urlpatterns = [
re_path(r"^token/login/?$", views.TokenCreateView.as_view(), name="login"),
re_path(r"^token/logout/?$", views.TokenDestroyView.as_view(), name="logout"),
re_path(r"^token/login/?$", TokenCreateView.as_view(), name="login"),
re_path(r"^token/logout/?$", TokenDestroyView.as_view(), name="logout"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may want to switch to url() instead of re_path by the way of doing this views split.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

]
95 changes: 90 additions & 5 deletions djoser/urls/base.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,96 @@
from django.contrib.auth import get_user_model
from rest_framework.routers import DefaultRouter
from django.urls import path

from djoser import views
from djoser.views.user.activation import UserActivationAPIView
from djoser.views.user.me import UserMeViewSet
from djoser.views.user.password_reset_confirm import UserPasswordResetConfirmAPIView
from djoser.views.user.resend_activation import UserResendActivationAPIView
from djoser.views.user.reset_password import UserResetPasswordAPIView
from djoser.views.user.reset_username import UserResetUsernameAPIView
from djoser.views.user.reset_username_confirm import UserResetUsernameConfirmAPIView
from djoser.views.user.set_password import UserSetPasswordAPIView
from djoser.views.user.set_username import UserSetUsernameAPIView
from djoser.views.user.user import UserViewSet

router = DefaultRouter()
router.register("users", views.UserViewSet)

User = get_user_model()

urlpatterns = router.urls

user_activation = path(
"users/activation/", UserActivationAPIView.as_view(), name="user-activation"
)
user_list = path(
"users/", UserViewSet.as_view({"get": "list", "post": "create"}), name="user-list"
)
user_detail = path(
f"users/<{UserViewSet.lookup_field}>/",
UserViewSet.as_view(
{
"get": "retrieve",
"put": "update",
"patch": "partial_update",
"delete": "destroy",
}
),
name="user-detail",
)
user_password_reset_confirm = path(
"users/reset_password_confirm/",
UserPasswordResetConfirmAPIView.as_view(),
name="user-reset-password-confirm",
)
user_resend_activation = path(
"users/resend-activation/",
UserResendActivationAPIView.as_view(),
name="user-resend-activation",
)
user_reset_password = path(
"users/reset_password",
UserResetPasswordAPIView.as_view(),
name="user-reset-password",
)
user_reset_username = path(
f"users/reset_{User.USERNAME_FIELD}",
UserResetUsernameAPIView.as_view(),
name="user-reset-username",
)
user_reset_username_confirm = path(
f"users/reset_{User.USERNAME_FIELD}_confirm",
UserResetUsernameConfirmAPIView.as_view(),
name="user-reset-username-confirm",
)
user_set_password = path(
"users/set_password", UserSetPasswordAPIView.as_view(), name="user-set-password"
)
user_set_username = path(
f"users/set_{User.USERNAME_FIELD}",
UserSetUsernameAPIView.as_view(),
name="user-set-username",
)

me_list = path(
"users/me/",
UserMeViewSet.as_view(
{
"get": "retrieve",
"put": "update",
"patch": "partial_update",
"delete": "destroy",
}
),
name="user-me",
)

urlpatterns = [
user_resend_activation,
user_activation,
user_password_reset_confirm,
user_reset_username_confirm,
user_reset_password,
user_set_password,
user_set_username,
user_reset_username,
me_list,
user_detail,
user_list,
]
Loading
Loading