Exemplo n.º 1
0
)
from rest_auth.registration.views import VerifyEmailView
from rest_auth.registration import urls as registration_urls
from allauth.account.views import ConfirmEmailView, EmailVerificationSentView
import nested_admin.urls
import django_prometheus.urls

from qabel_web_theme import urls as theme_urls
from dispatch_service.views import dispatch

# Import the module somewhere, so it can register itself.
import qabel_provider.monitoring

rest_auth_register_urls = [
    url(r'^$', views.PasswordPolicyRegisterView.as_view(), name='rest_register'),
    url(r'^verify-email/$', VerifyEmailView.as_view(), name='rest_verify_email'),
]

rest_auth_urls = [
    url(r'^password/reset/$', PasswordResetView.as_view(),
        name='rest_password_reset'),
    url(r'^password/reset/confirm/$', PasswordResetConfirmView.as_view(),
        name='rest_password_reset_confirm'),
    url(r'^login/$', views.ThrottledLoginView.as_view(), name='rest_login'),
    url(r'^logout/$', LogoutView.as_view(), name='rest_logout'),
    url(r'^user/$', UserDetailsView.as_view(), name='rest_user_details'),
    url(r'^password/change/$', PasswordChangeView.as_view(),
        name='rest_password_change'),
]

rest_urls = [
Exemplo n.º 2
0
from rest_auth.views import (
    LoginView,
    LogoutView,
    UserDetailsView,
    PasswordChangeView,
    PasswordResetView,
    PasswordResetConfirmView,
)

from rest_auth.registration.views import RegisterView, VerifyEmailView

# Registration URLs
urlpatterns = [
    url(r'^register/$', RegisterView.as_view(), name='rest_register'),
    url(r'^verify-email/$',
        VerifyEmailView.as_view(),
        name='rest_verify_email'),
    url(r'^account-confirm-email/(?P<key>[-:\w]+)/$',
        views.CustomVerifyEmailView.as_view(),
        name='account_confirm_email'),
]

# Authorization and account management urls
urlpatterns += [
    url(r'^refresh-token/', refresh_jwt_token),
    url(r'^password/reset/$',
        PasswordResetView.as_view(),
        name='rest_password_reset'),
    url(r'^password/reset/confirm/$',
        PasswordResetConfirmView.as_view(),
        name='rest_password_reset_confirm'),
Exemplo n.º 3
0
user_router = UserRouter()
router = SimpleRouter()

user_router.register(r'user', UserViewSet)
router.register(r'social_account', UserSocialAuthViewSet)
router.register(r'social_person', SocialPersonViewSet)

urlpatterns = [
    url(r'^', include('django.contrib.auth.urls')),
    url(r'^admin/', admin.site.urls),

    url(r'^api/auth/registration/', RegisterView.as_view(), name='register_view'),
    url(r'^api/auth/login/$', rest_auth.views.LoginView.as_view(), name='rest_login'),
    url(r'^api/auth/logout/$', rest_auth.views.LogoutView.as_view(), name='rest_logout'),
    url(r'^api/auth/confirm_email/$', VerifyEmailView.as_view()),

    url(
        r'^api/auth/password/confirm/$',
        rest_auth.views.PasswordResetConfirmView.as_view(),
        name='password_reset_confirm'
    ),
    url(r'^api/auth/password/reset/$', rest_auth.views.PasswordResetView.as_view()),
    url(r'^api/auth/password/change/$', PasswordChangeView.as_view()),

    url(r'^api/social_auth/login/social/token/(?:(?P<provider>[a-zA-Z0-9_-]+)/?)?$',
        SocialAuthView.as_view(),
        name='login_social_token'),

    url(r'^api/', include(user_router.urls)),
    url(r'^api/', include(router.urls))
Exemplo n.º 4
0
from django.views.generic import TemplateView
from custom_user.auth import TestAuthView
from rest_auth.views import LoginView, LogoutView
from rest_auth.registration.views import RegisterView, VerifyEmailView

urlpatterns = [
    path('admin/', admin.site.urls),
    path(
        'test_auth/',
        TestAuthView.as_view(),
        name='test_auth',
    ),
    path(
        'rest-auth/logout/',
        LogoutView.as_view(),
        name='rest_logout',
    ),
    path(
        'rest-auth/login/',
        LoginView.as_view(),
        name='rest_login',
    ),
    path('rest-auth/register/', RegisterView.as_view(), name='rest_register'),
]

urlpatterns += [
    url(r'^verify-email', VerifyEmailView.as_view(), name='verify_email'),
    url(r'^account-confirm-email/(?P<key>[-:\w]+)/$',
        TemplateView.as_view(),
        name='account_confirm_email'),
]
    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.contrib import admin
from django.urls import path, re_path, include
from rest_auth.registration.views import VerifyEmailView

from authentication import views

urlpatterns = [
    path('admin/', admin.site.urls),

    path('login/', views.LoginView.as_view(), name='account_login'),
    path('', include('rest_auth.urls')),
    path('registration/', views.RegisterView.as_view(), name='account_signup'),
    path('registration/', include('rest_auth.registration.urls')),

    re_path(r'^account-confirm-email/sent', views.django_rest_auth_null,
            name='account_email_verification_sent'),
    re_path(r'^account-confirm-email/(?P<key>[-:\w]+)/$', VerifyEmailView.as_view(),
            name='account_confirm_email'),

    path('verify-phone-number/', views.VerifyPhoneView.as_view()),
]
Exemplo n.º 6
0
from rest_framework import routers
from django.urls import path, include
from django.conf.urls.static import static
from django.conf import settings as django_settings
from .api import *
from .views import *
from rest_auth.registration.views import RegisterView, VerifyEmailView
from rest_auth.views import PasswordChangeView, PasswordResetView, PasswordResetConfirmView

router = routers.DefaultRouter()

urlpatterns = router.get_urls() + [
    path('api/login', LoginView.as_view()),
    path('api/logout', LogoutView.as_view()),
    path('api/register', RegisterView.as_view()),
    path('api/verify-email', VerifyEmailView.as_view()),
    path('api/user_data', user_data),
    path('api/settings', change_settings),
    path('api/change-password', PasswordChangeView.as_view()),
    path('api/reset-password', PasswordResetView.as_view()),
    path('api/confirm-password', PasswordResetConfirmView.as_view()),
    path('api/get-items', get_items),
    path('api/get-item', get_item),
    path('api/get-favorites', get_favorites),
    path('api/add-favorite', add_favorite),
    path('api/get-suggestions', suggestion),
    path('api/create_pay', Pay.as_view()),
    path('pay_notify', pay_notify),
    path('api/check-payment', check_payment),
    path('api/pay-order', pay_order),
    path('api/order-history', get_orders),
Exemplo n.º 7
0
    LoginView,
    FacebookLogin,
    InstagramLogin,
    GoogleLogin,
    RegisterView,
    ConfirmEmailView,
    PasswordResetView
)

urlpatterns = [
    ###########################
    # REGISTRATION URLS
    ###########################
    path('registration/', RegisterView.as_view(), name='rest_register'),
    # url for verifying email
    path('registration/verify-email/', VerifyEmailView.as_view(), name='rest_verify_email'),
    # url for account confirmation
    path('registration/account-confirm-email/<str:key>', ConfirmEmailView.as_view(), name='account_confirm_email'),
    # url for informing the user that the verification in sent
    path("registration/confirm-email/", email_verification_sent, name="account_email_verification_sent"),

    ###########################
    # AUTHENTICATION URLS
    ###########################
    path('login/', LoginView.as_view(), name='rest_login'),
    path('logout/', LogoutView.as_view(), name='rest_logout'),

    ###########################
    # PASSWORD HANDLING URLS
    ###########################
    path('password/reset/', PasswordResetView.as_view(), name='rest_password_reset'),
Exemplo n.º 8
0
from rest_auth.registration.views import VerifyEmailView

from django.conf.urls import url

from . import views


urlpatterns = [
    url('register/', views.UserRegisterView.as_view(), name='register'),
    url('confirm-email/(?P<key>[-:\w]+)/$', VerifyEmailView.as_view(),
        name='account_confirm_email'),
]