ユーザーアカウントの処理にDjangoのREST認証を使用しています。ユーザー情報を更新するために、カスタムエンドポイントを作成したので、djnago-rest-authで生成されたエンドポイントは必要ありません/rest-auth/user/ (GET, PUT, PATCH)
。これらのエンドポイントを削除するにはどうすればよいですか?
urls.py
urlpatterns = [
path('', include("rest_auth.urls"), name="user-auth"),
path('register', include('rest_auth.registration.urls'), name="user-auth-registration"),
path('<uid>/', views.UserProfileView.as_view(), name="user-profile"),
]
編集
ログイン、登録など、rest-authの他のすべてのURLを使用したいのですが、ここで/rest-auth/user/
説明されているようにしたくありません。
@bodoubleuの答えがうまくいかなかったので、手動で追加しました。
from rest_auth.views import (
LoginView, LogoutView, PasswordChangeView,
PasswordResetView, PasswordResetConfirmView
)
urlpatterns = [
path('register', include('rest_auth.registration.urls'), name="user-auth-registration"),
path('login', LoginView.as_view(), name="user-login"),
path('logout', LogoutView.as_view(), name='user-logout'),
path('password/change/', PasswordChangeView.as_view(), name='rest_password_change'),
path('password/reset', PasswordResetView.as_view(), name='rest_password_reset'),
path('password/reset/confirm/', PasswordResetConfirmView.as_view(), name='rest_password_reset_confirm'),
path('<uid>/', views.UserProfileView.as_view(), name="user-profile"),
]
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加