funkwhale/api/funkwhale_api/users/rest_auth_urls.py

36 wiersze
1.3 KiB
Python
Czysty Zwykły widok Historia

from django.conf.urls import url
2018-06-10 08:55:16 +00:00
from django.views.generic import TemplateView
2018-05-06 09:30:41 +00:00
from rest_auth import views as rest_auth_views
2018-06-10 08:55:16 +00:00
from rest_auth.registration import views as registration_views
2018-05-06 09:30:41 +00:00
from . import views
urlpatterns = [
2018-06-09 13:36:16 +00:00
url(r"^$", views.RegisterView.as_view(), name="rest_register"),
url(
r"^verify-email/?$",
2018-05-06 09:30:41 +00:00
registration_views.VerifyEmailView.as_view(),
2018-06-09 13:36:16 +00:00
name="rest_verify_email",
),
url(
r"^change-password/?$",
2018-05-06 09:30:41 +00:00
rest_auth_views.PasswordChangeView.as_view(),
2018-06-09 13:36:16 +00:00
name="change_password",
),
# This url is used by django-allauth and empty TemplateView is
# defined just to allow reverse() call inside app, for example when email
# with verification link is being sent, then it's required to render email
# content.
# account_confirm_email - You should override this view to handle it in
# your API client somehow and then, send post to /verify-email/ endpoint
# with proper key.
# If you don't want to use API on that step, then just use ConfirmEmailView
# view from:
# djang-allauth https://github.com/pennersr/django-allauth/blob/master/allauth/account/views.py#L190
2018-06-09 13:36:16 +00:00
url(
r"^account-confirm-email/(?P<key>\w+)/?$",
2018-06-09 13:36:16 +00:00
TemplateView.as_view(),
name="account_confirm_email",
),
]