示例#1
0
from dj_rest_auth.registration.views import VerifyEmailView, ConfirmEmailView
from dj_rest_auth.views import PasswordResetConfirmView
from django.urls import path, include

from .views import email_verified, GetUserView

urlpatterns = [
    path('auth/password/reset/confirm/<slug:uidb64>/<slug:token>/',
         PasswordResetConfirmView.as_view(),
         name='password_reset_confirm'),
    path('auth/registration/account-confirm-email/<str:key>/',
         ConfirmEmailView.as_view()),
    path('auth/', include('dj_rest_auth.urls')),
    path('auth/registration/', include('dj_rest_auth.registration.urls')),
    path('auth/account-confirm-email/',
         VerifyEmailView.as_view(),
         name='account_email_verification_sent'),
    path('email-verified', email_verified),
    path('user/<int:pk>', GetUserView.as_view()),
]
示例#2
0
from django.contrib import admin
from django.urls import path, include
from django.conf import settings
from django.conf.urls.static import static
from dj_rest_auth.registration.views import VerifyEmailView, ConfirmEmailView
from dj_rest_auth.views import PasswordResetConfirmView
from users.views import FacebookLogin

urlpatterns = [
    path('admin/', admin.site.urls),         
    path('accounts/', include('allauth.urls'), name='socialaccount_signup'),
    path('rest-auth/', include('dj_rest_auth.urls')),   
    path('rest-auth/registration/account-confirm-email/<str:key>/', ConfirmEmailView.as_view()), 
    path('rest-auth/registration/', include('dj_rest_auth.registration.urls')),
    path('rest-auth/account-confirm-email/', VerifyEmailView.as_view(), name='account_email_verification_sent'),
    path('rest-auth/password/reset/confirm/<slug:uidb64>/<slug:token>/', PasswordResetConfirmView.as_view(), name='password_reset_confirm'),
    path('rest-auth/facebook/', FacebookLogin.as_view(), name='fb_login'),    
    path('api/items/', include('items.urls')),
    path('api/users/', include('users.urls')),   
    path('djrichtextfield/', include('djrichtextfield.urls'))    
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
示例#3
0
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""

from django.conf import settings
from django.contrib import admin
from django.urls import path, include
from django.conf.urls.static import static
from dj_rest_auth.views import PasswordResetView, PasswordResetConfirmView

urlpatterns = [
    path('api/posts/', include('posts.urls')),
    path('admin/', admin.site.urls),
    path('users/', include('users.urls')),

    path('password-reset/', PasswordResetView.as_view()),
    path('password-reset-confirm/<uidb64>/<token>/',
         PasswordResetConfirmView.as_view(), name='password_reset_confirm'),
]

if settings.DEBUG:
    urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
示例#4
0
from dj_rest_auth.views import PasswordResetConfirmView
from django.urls import path, include
from rest_framework import routers

from accounts.views import UserViewSet, GoogleLogin

router = routers.DefaultRouter()
router.register(r'', UserViewSet)

urlpatterns = [
    path('', include(router.urls)),
    path('rest-auth/google/', GoogleLogin.as_view(), name='google_login'),
    path('password/reset/confirm/<uidb64>/<token>/', PasswordResetConfirmView.as_view(), name='password_reset_confirm'),
    path('rest-auth/', include('dj_rest_auth.urls'))
]
示例#5
0
from django.urls import path, include
from . import views
from dj_rest_auth.views import (LoginView, LogoutView, PasswordChangeView,
                                PasswordResetConfirmView, PasswordResetView,
                                UserDetailsView)


urlpatterns = [
    path('register/', views.UserRegistrationView.as_view(), name='user-registration'),
    path('user/',views.UserDetailsView.as_view(), name='user-details'),
    path('all-users/', views.ListUsersView.as_view(), name='all-users'),
    path('login/', views.UserLoginView.as_view(), name= 'user-register'),
    path('password/reset/', views.PasswordResetView.as_view(), name='rest_password_reset'),
    path('password/reset/confirm/', PasswordResetConfirmView.as_view(),name='password_reset_confirm')
    # path('auth/', include('djoser.urls.jwt')),
]