コード例 #1
0
    def create(self, request, *args, **kwargs):
        """
            :return: HTTP_201_CREATED and JSON-Documents: if all good
                    HTTP_400_BAD_REQUEST: if some problems with serializer
        """
        result = {'status': '', 'data': {}}

        serializer = self.get_serializer(data=request.data)
        if not serializer.is_valid():

            result['data'] = serializer.errors

            return Response(result, status=status.HTTP_400_BAD_REQUEST)

        return RegisterView.create(self, request, *args, **kwargs)
コード例 #2
0
The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/3.0/topics/http/urls/
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.contrib import admin
from django.urls import path, include
from rest_auth.registration.views import RegisterView
from rest_auth.views import LogoutView, LoginView

urlpatterns = [
    path('admin/', admin.site.urls),
    path(
        'api/',
        include([
            path('users/', include('users.urls')),
            path('registration/', RegisterView.as_view()),
            path('login/', LoginView.as_view()),
            path('logout/', LogoutView.as_view()),
        ])),
]
コード例 #3
0
from allauth.account.views import ConfirmEmailView
from django.conf.urls import url
from rest_auth.registration.views import RegisterView, VerifyEmailView

from profiles.api import ResendVerificationView

urlpatterns = [
    url(r'^$', RegisterView.as_view(), name='rest_register'),
    url(r'^verify-email/$', VerifyEmailView.as_view(), name='rest_verify_email'),
    url(r'^resend-verify-email/$', ResendVerificationView.as_view(), name='resend_verification_email'),
    url(r'^success/$', ConfirmEmailView.as_view(), name='account_email_verification_sent'),

    url(r'^account-confirm-email/(?P<key>[-:\w]+)/$', ConfirmEmailView.as_view(),
        name='account_confirm_email'),
]
コード例 #4
0
ファイル: urls.py プロジェクト: jatinkaushik/django-phoneuser
from django.conf.urls import url
from rest_auth.registration.views import RegisterView

from phoneuser.views import user_register

urlpatterns = [
    url(r'^register-form$', user_register, name='register'),
    url(r'^register-rest', RegisterView.as_view(), name='register_rest')
]
コード例 #5
0
urlpatterns = [
    # URLs that do not require a session or valid token
    url(r'^auth/login/$', LoginView.as_view(), name='rest_login'),
    url(r'^auth/password/reset/$',
        PasswordResetView.as_view(),
        name='rest_password_reset'),
    url(r'^auth/password/reset/confirm/$',
        PasswordResetConfirmView.as_view(),
        name='rest_password_reset_confirm'),

    # URLs that require a user to be logged in with a valid session / token.
    url(r'^auth/logout/$', LogoutView.as_view(), name='rest_logout'),
    url(r'^auth/user/$', UserDetailsView.as_view(), name='rest_user_details'),
    url(r'^auth/password/change/$',
        PasswordChangeView.as_view(),
        name='rest_password_change'),
    url(r'^auth/registration/$', RegisterView.as_view(), name='rest_register'),
    url(r'^auth/registration/verify-email/$',
        VerifyEmailView.as_view(),
        name='rest_verify_email'),
    url(r'^auth/account-confirm-email/(?P<key>[-:\w]+)/$',
        TemplateView.as_view(),
        name='account_confirm_email'),
]

# Social API endpoints
if 'allauth.socialaccount' in settings.INSTALLED_APPS:
    urlpatterns += [
        url(r'^auth/facebook/$', FacebookLogin.as_view(), name='fb_login')
    ]
コード例 #6
0
from rest_auth.views import LoginView
from rest_auth.registration.views import RegisterView
from django.urls import path
from django.conf.urls import include, url
from django.views.decorators.csrf import csrf_exempt

urlpatterns = [
    # path('', include('rest_auth.urls')),
    # path('registration/', include('rest_auth.registration.urls')),
    path("api-login/", csrf_exempt(LoginView.as_view()), name="api-login"),
    path("api-register/",
         csrf_exempt(RegisterView.as_view()),
         name="api-register"),
    url(r'^rest-auth/', include('rest_auth.urls')),
    url(r'^rest-auth/registration/', include('rest_auth.registration.urls')),
]
コード例 #7
0
from django.urls import path, re_path, include
from rest_auth.registration.views import RegisterView, VerifyEmailView, ConfirmEmailView
from rest_auth.views import LoginView, LogoutView, PasswordResetView, PasswordResetConfirmView

from .views import *
from .admin_views import *

urlpatterns = [
    #path('signup/',SignUpView.as_view()),
    path('account-confirm-email/<str:key>/', ConfirmEmailView.as_view()),
    path('signup/', RegisterView.as_view()),
    path('login/', LoginView.as_view()),
    path('logout/', LogoutView.as_view()),
    path('verify-email/', VerifyEmailView.as_view(), name='rest_verify_email'),
    path('account-confirm-email/',
         VerifyEmailView.as_view(),
         name='account_email_verification_sent'),
    re_path(r'^account-confirm-email/(?P<key>[-:\w]+)/$',
            VerifyEmailView.as_view(),
            name='account_confirm_email'),
    path('password-reset/', PasswordResetView.as_view()),
    path('password-reset-confirm/<uidb64>/<token>/',
         PasswordResetConfirmView.as_view(),
         name='password_reset_confirm'),
    path('profile/', UserProfileView.as_view()),
    path('user-status/', UserStatusView.as_view()),
    path('new-post/', post_create_view),
    path('post-list/', PostListView.as_view()),
    path('update-post/', post_update_view),
    path('delete-post/', post_delete_view),
]
コード例 #8
0
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, include
from django.conf.urls import url
from django.views.generic.base import TemplateView
from rest_framework_simplejwt.views import (
    TokenObtainPairView,
    TokenRefreshView, TokenVerifyView,
)
from rest_auth.registration.views import RegisterView
from shout_app.authentication.views import EmailConfirmAPIView

urlpatterns = [
    path('', TemplateView.as_view(template_name='home.html'), name='home'),
    # path('admin/', admin.site.urls),
    path('', include('shout_app.authentication.urls')),
    path('', include('shout_app.profile.urls')),
    path('', include('shout_app.shouts.urls')),
    path('api/request-auth-token', TokenObtainPairView.as_view(), name='token_obtain_pair'),
    path('api/request-auth-token/refresh', TokenRefreshView.as_view(), name='token_refresh'),
    path('api/request-auth-token/verify', TokenVerifyView.as_view(), name='token_verify'),
    path('api/signup/', RegisterView.as_view(), name='account_signup'),
    url('confirm_email/(?P<key>[-:\w]+)/$', EmailConfirmAPIView.as_view(), name='account_confirm_email')
]
コード例 #9
0
    PasswordChangeView,
    PasswordResetView,
    PasswordResetConfirmView,
)
from rest_framework_simplejwt.views import (
    TokenObtainPairView,
    TokenRefreshView,
    TokenVerifyView
)

from django.conf import settings
from auth.views import LoginView, LogoutView

rest_auth_registration_urls = [
    # allauth login/logout/password
    re_path(r"^registration/$", RegisterView.as_view(), name="account_signup"),
    re_path(r"^registration/verify-email/$",VerifyEmailView.as_view(),name="rest_verify_email",)
]


urlpatterns = [
    # rest_auth login/logout/password
    re_path(r"^login/$", LoginView.as_view(), name="rest_login"),
    re_path(r"^logout/$", LogoutView.as_view(), name="rest_logout"),
    re_path(r"^password/reset/$", PasswordResetView.as_view(), name="rest_password_reset"),
    re_path(r"^password/reset/confirm/$",PasswordResetConfirmView.as_view(),name="rest_password_reset_confirm",),
    re_path(r"^password/change/$", PasswordChangeView.as_view(), name="rest_password_change" ),

    #rest_framework_simplejwt
    re_path(r"^token/obtain/$", TokenObtainPairView.as_view(), name='token_obtain_pair'),
    re_path(r"^token/refresh/$", TokenRefreshView.as_view(), name='token_refresh'),
コード例 #10
0
from django.urls import path, include
from rest_auth.registration.views import RegisterView
from rest_auth.views import LoginView

from . import views


urlpatterns = [
    path('', views.index),
    path('rest-auth/login/', LoginView.as_view(), name="rest_login"),
    path('rest-auth/registration/', RegisterView.as_view(), name="rest_register"),
]
コード例 #11
0
router = DefaultRouter()
router.register(r'chat', views.UsersChatRecoredsViewSet)
router.register(r'user-channels', views.UserChannelsViewSet)
router.register(r'all-channels', views.AllChannelsViewSet)

urlpatterns = [
    url(r'^', include(router.urls)),
    url(r'^rest-auth/', include('rest_auth.urls')),
    url(r'^accounts/', include('allauth.urls')),
    url(r'^rest-auth/auth/', include('rest_auth.registration.urls')),
]

# Auth URLs
urlpatterns += [
    url(r'^register', RegisterView.as_view(), name='register'),
    url(r'^verify-email', VerifyEmailView.as_view(), name='verify_email'),
    url(r'^login', LoginView.as_view(), name='login'),
    url(r'^logout', LogoutView.as_view(), name='logout'),

    # Password Reset
    url(r'^reset-password', PasswordResetView.as_view(), name='resetPassword'),
    #POST NEW PASSWORD HERE
    url(r'^reset/password/confirm',
        PasswordResetConfirmView.as_view(),
        name='password_reset_confirm'),
    # Change Password
    url(r'^change-password',
        PasswordChangeView.as_view(),
        name='change_password'),
    url(r'^account-confirm-email/(?P<key>[-:\w]+)/$',
コード例 #12
0
ファイル: urls.py プロジェクト: Ableglobe/rovercode-web
    url(
        r'^login/',
        views.GoogleCallbackCreate.as_view(),
        name='google_callback_login',
    ),
    url(
        r'^connect/',
        views.GoogleCallbackConnect.as_view(),
        name='google_callback_connect',
    ),
]

urlpatterns = [
    url(r'^auth/', include('rest_auth.urls')),
    url(r'^auth/registration/$',
        csrf_exempt(RegisterView.as_view()), name='rest_register'),
    url(r'^auth/registration/verify-email/$',
        csrf_exempt(VerifyEmailView.as_view()), name='rest_verify_email'),
    url(r'^auth/registration/account-confirm-email/(?P<key>[-:\w]+)/$',
        csrf_exempt(TemplateView.as_view()),
        name='account_confirm_email'),
    url(r'^auth/social/github/', include(github_urlpatterns)),
    url(r'^auth/social/google/', include(google_urlpatterns)),
    url(
        r'^auth/user/accounts/',
        SocialAccountListView.as_view(),
        name='social_account_list',
    ),
    url(
        r'^auth/user/accounts/<int:pk>/disconnect/',
        SocialAccountDisconnectView.as_view(),
コード例 #13
0
    path(
        'api/auth/is_logged_in',
        TestAuthView.as_view(),
        name='is_logged_in',
    ),
    path(
        'api/auth/logout',
        LogoutViewEx.as_view(),
        name='logout',
    ),
    path(
        'api/auth/login',
        LoginView.as_view(),
        name='login',
    ),
    path('api/auth/register', RegisterView.as_view(), name='register'),
    path('api/auth/email', UserEmailView.as_view(), name='user_email'),
    path('api/auth/password/change',
         PasswordChangeView.as_view(),
         name='password_change'),
    path('api/auth/account-confirm-email',
         VerifyEmailView.as_view(),
         name='account_email_verification_sent'),
    path('api/auth/account-confirm-email/<str:key>',
         VerifyEmailView.as_view(),
         name='account_confirm_email'),
    path('api/projects/', Projects.as_view()),
    path('api/projects/<int:project_id>', Projects.as_view()),

    # path('api/logical_models/', LogicalModels.as_view()),
    path('api/logical_models/<int:project_id>/', LogicalModels.as_view()),
コード例 #14
0
from .views import DashboardTemplateView

from apps.user.api.api_rest import UserViewSet
from apps.task.api.api_rest import TaskViewSet

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

routerPublic = routers.DefaultRouter()

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^accounts/', include('allauth.urls')),
    url(r'^django-des/', include(des_urls)),

    # API
    url(r'^api/accounts/login/$', LoginView.as_view(), name='login'),
    url(r'^api/accounts/logout/$', LogoutView.as_view(), name='logout'),
    url(r'^api/accounts/register/$', RegisterView.as_view(), name='logout'),
    url(r'^api/', include(router.urls)),
    url(r'^api/public/', include(routerPublic.urls)),

    url(r'^docs/', include_docs_urls(title='API Doc skol', description="Status code: http://www.django-rest-framework.org/api-guide/status-codes/", public=True, permission_classes=[AllowAny])),


    url(r'', login_required(DashboardTemplateView.as_view())),
]

if settings.DEBUG:
    urlpatterns = static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) + urlpatterns
コード例 #15
0
     views.CheckoutView.as_view(),
     name='checkout'),
 url(r'^brand/(?P<brand_id>\d+)/(?P<pk>\d+)/checkout/(?P<flag>\w+)/$',
     views.CheckoutResultView.as_view(),
     name='checkout_result'),
 url(r'^filter/(?P<filter_flag>\w+)/(?P<brand_id>\d+)/',
     views.BrandContent.as_view(),
     name='filter'),
 url(r'^search/$', views.SearchView.as_view(), name='search'),
 url(r'^comment/$', views.CommentContent.as_view(), name='comment'),
 url(r'^delete/car/$', views.DeleteCarView.as_view(), name='delete_car'),
 url(r'^home$|^$', views.IndexView.as_view(), name='home'),
 url(r'^admin/', include(admin.site.urls)),
 url(r'^api/v1/', include('rest_auth.urls')),
 url(r'^api/v1/register/$',
     RegisterView.as_view(serializer_class=RegSerializer)),
 url(r'^rest-auth/registration/', include('rest_auth.registration.urls')),
 url(r'^api/v1/adds/$', api_views.AdvertisementList.as_view()),
 url(r'^api/v1/cars/$', api_views.CarList.as_view()),
 url(r'^api/v1/cars/(?P<pk>\d+)/$',
     api_views.CarDetail.as_view(),
     name='car-detail'),
 url(r'^api/v1/users/$', api_views.UserList.as_view()),
 url(r'^api/v1/users/(?P<pk>\d+)/$',
     api_views.UserDetail.as_view(),
     name='user-detail'),
 url(r'^api/v1/me/$', api_views.MyDetail.as_view()),
 url(r'^api/v1/comments/$', api_views.CommentList.as_view()),
 url(r'^api/v1/comments/(?P<pk>\d+)/$',
     api_views.CommentDetail.as_view(),
     name='comment-detail'),
コード例 #16
0
    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.conf import settings
from django.conf.urls.static import static
from django.urls import path, re_path, include
from django.views.generic import TemplateView
from allauth.account.views import confirm_email
from rest_auth.registration.views import RegisterView

from .routers import router
from accounts.views import FacebookLogin, GoogleLogin

urlpatterns = [
    path('admin/', admin.site.urls),
    re_path(r'^', include('django.contrib.auth.urls')),
    re_path(r'^rest-auth/', include('rest_auth.urls')),
    re_path(r'^rest-auth/registration/$',  RegisterView.as_view(),
            name='rest_register'),
    re_path(r"^rest-auth/registration/account-confirm-email/(?P<key>[\s\d\w().+-_',:&]+)/$",
            confirm_email, name="account_confirm_email"),
    re_path(r'^accounts/', include('allauth.urls')),
    re_path(r'^rest-auth/facebook/$', FacebookLogin.as_view(), name='fb_login'),
    re_path(r'^rest-auth/google/$', GoogleLogin.as_view(), name='google_login'),
    re_path(r'^api/', include(router.urls))
]+static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
コード例 #17
0
from django.conf.urls import url
from rest_auth.views import LoginView, LogoutView
from rest_auth.registration.views import VerifyEmailView, RegisterView
from django.views.generic.base import RedirectView
from accounts.views import UserDetailsView
from allauth.account import views

urlpatterns = [
    url(r'^login/$', LoginView.as_view(), name='login'),
    url(r'^logout/$', LogoutView.as_view(), name='logout'),
    url(r'^user/$', UserDetailsView.as_view(), name='user_details'),
    url('^registration/$', RegisterView.as_view(), name='register'),
    url(r'^verify-email/$',
        VerifyEmailView.as_view(),
        name='account_email_verification_sent'),
    #url(r'^confirm-email/(?P<key>[-:\w]+)/$', RedirectView.as_view(url='http://127.0.0.1:8000/accounts/login/', permanent=False) , name="account_confirm_email"),
    url(r"^confirm-email/(?P<key>[\s\d\w().+-_',:&]+)/$",
        views.confirm_email,
        name="account_confirm_email"),
]
コード例 #18
0
from django.conf.urls import url
from rest_auth.registration.views import RegisterView
from rest_auth.views import LoginView

from applications.accounts import views
from applications.accounts.views import UserVerifyJWT, ChangePasswordView

urlpatterns = [
    url(r'^signup/', RegisterView.as_view(), name='account_signup'),
    url(r'^login/', LoginView.as_view(), name='account_login'),
    url(r'^change-password/',
        ChangePasswordView.as_view(),
        name='change_password'),
    url(r'^api-token-verify/', UserVerifyJWT.as_view()),
    url(r'^profile/$', views.UserProfileView.as_view(), name='user_profile'),
    url(r'^destroy/$', views.UserProfileDestroyView.as_view(), name='destroy')
]
コード例 #19
0
from django.conf.urls import url, include
from django.contrib import admin

from django.conf import settings
from django.conf.urls.static import static

from djbr import views
from django.views.generic import TemplateView
from rest_framework_jwt.views import obtain_jwt_token
from rest_auth.registration.views import RegisterView

urlpatterns = [
    url(r'^api/', include('djbr.urls')),
    url(r'^admin/', admin.site.urls),
    url(r'^api-auth/', include('rest_framework.urls')),
    url(r'^api-token-auth/', obtain_jwt_token),
    url(r'^rest-auth/', include('rest_auth.urls')),
    url(r'^rest-auth/registration/', include('rest_auth.registration.urls')),
    url(r'^api/users/', RegisterView.as_view()),
    url(r'^api/contact/?$', views.ContactDetail.as_view()),
]

urlpatterns += url(r'^(?P<path>.*)$', views.index),
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
コード例 #20
0
from categories.models import Category
from django.contrib import admin
from django.urls import path
from tasks.views import TaskView
from categories.views import CategoryView
from users.views import UserView
from rest_auth.views import LoginView
from rest_auth.registration.views import RegisterView

urlpatterns = [
    path('admin/', admin.site.urls),
    path('signin', LoginView.as_view(), name='rest_login'),
    path('signup', RegisterView.as_view(), name='rest_register'),
    path(
        'user/<int:pk>',
        UserView.as_view({
            'get': 'retrieve',
            'put': 'update',
            'delete': 'destroy'
        })),
    path('task/create', TaskView.as_view({'post': 'create'})),
    path(
        'task/<int:pk>',
        TaskView.as_view({
            'get': 'retrieve',
            'put': 'update',
            'delete': 'destroy'
        })),
    path('task>', TaskView.as_view({'get': 'list'})),
    path(
        'category/<int:pk>',
コード例 #21
0
ファイル: urls.py プロジェクト: Hall-Erik/recipebox-django-ng
                             PasswordChangeView)
from rest_auth.registration.views import RegisterView
from . import views

urlpatterns = [
    path('api/sign_s3/', views.SignS3View.as_view(), name='sign_s3'),
    path('api/recipes/',
         views.RecipeListCreate.as_view(),
         name='recipe_list_create'),
    path('api/recipes/<id>', views.RecipeRUD.as_view(), name='recipe_rud'),
    path('api/recipes/<id>/made/',
         views.MakeRecipeView.as_view(),
         name='recipe_make'),
    path('api/users/<id>/recipes/',
         views.UserRecipeListView.as_view(),
         name='user_recipes'),
    path('api/register/', RegisterView.as_view(), name='api_register'),
    path('api/login/', LoginView.as_view(), name='rest_login'),
    path('api/logout/', LogoutView.as_view(), name='rest_logout'),
    path('api/user/', UserDetailsView.as_view(), name='rest_user_details'),
    path('api/password/change/',
         PasswordChangeView.as_view(),
         name='rest_password_change'),
    path('api/password/reset/',
         include('django_rest_passwordreset.urls',
                 namespace='password_reset')),
    url(r'^.*',
        TemplateView.as_view(template_name='ng/index.html'),
        name='home'),
]
コード例 #22
0
ファイル: views.py プロジェクト: eyobofficial/receipt-api
    })(PasswordResetConfirmView.as_view())

registration_view = swagger_auto_schema(
    operation_summary='Register a new user',
    operation_description='''
        This endpoint registers a new user account. It also sends an email that
        contains a verification link to activate the account.
    ''',
    operation_id='user-registration',
    methods=['POST'],
    tags=['User Accounts'],
    security=[],
    responses={
        status.HTTP_200_OK: RegisterSerializer,
        status.HTTP_400_BAD_REQUEST: 'Validation errors.'
    })(RegisterView.as_view())


@method_decorator(name='get',
                  decorator=swagger_auto_schema(
                      operation_id='user-detail',
                      operation_summary='Get authenticated user detail',
                      operation_description='''
            This endpoint returns all the model fields for the current authenticated
            User object.
        ''',
                      tags=['User Accounts'],
                      responses={
                          status.HTTP_200_OK: UserDetailsSerializer,
                          status.HTTP_401_UNAUTHORIZED: 'Unauthorized request.'
                      }))
コード例 #23
0
from api.views.business_views import BusinessList, BusinessDetail, SearchBusinessLists
from api.views.review_views import ReviewList

# Create a router and register our viewsets with it.
router = DefaultRouter()
# router.register(r'businesses', BusinessViewSet)
# router.register(r'reviews', views.ReviewViewSet)
router.register(r'users', UserViewSet)

# The API URLs are now determined automatically by the router.

urlpatterns = [
    url(r'^', include(router.urls)),

    # reviewing business
    url(r'^businesses/$', BusinessList.as_view(), name="businesses"),
    url(r'^businesses/(?P<pk>[0-9]+)/$', BusinessDetail.as_view(), name="business"),
    url(r'^businesses/(?P<id>[0-9]+)/reviews/$', ReviewList.as_view(), name="reviews"),
    # searching
    url(r'^businesses/search/$', SearchBusinessLists.as_view()),

    # authuentication urls
    url(r'^auth/', include('rest_auth.urls')),
    url(r'^auth/register/', include('rest_auth.registration.urls')),
    path('registration/', RegisterView.as_view(), name='account_signup'),
    re_path(r'^account-confirm-email/', VerifyEmailView.as_view(),
    name='account_email_verification_sent'),
    re_path(r'^account-confirm-email/(?P<key>[-:\w]+)/$', VerifyEmailView.as_view(),
    name='account_confirm_email'),
]
コード例 #24
0
ファイル: urls.py プロジェクト: Hobbyfiguras/backend
from django.conf.urls.static import static
from django.views.decorators.csrf import csrf_exempt
from django.utils.decorators import method_decorator
from FigureSite.auth import CustomPasswordResetView
from rest_auth.registration.views import RegisterView, VerifyEmailView
from rest_auth.views import (LoginView, LogoutView, UserDetailsView,
                             PasswordChangeView, PasswordResetView,
                             PasswordResetConfirmView)

from django.middleware.csrf import get_token

from rest_framework_simplejwt.views import (TokenRefreshView)

from FigureSite.auth import TokenObtainPairView

urlpatterns = [
    path('djadmin/', admin.site.urls),
    path('api/mfc/', include('mfc.urls')),
    path('api/', include('FigureSite.urls')),
    path('api/auth/register/', RegisterView.as_view()),
    path('api/auth/register/verify-email/', VerifyEmailView.as_view()),
    path('api/auth/change_password/', csrf_exempt(
        PasswordChangeView.as_view())),
    path('api/auth/password_reset/',
         CustomPasswordResetView.as_view(),
         name='password_reset_confirm'),
    path('api/auth/password_reset/verify/',
         csrf_exempt(PasswordResetConfirmView.as_view())),
    path('api/auth/login/', TokenObtainPairView.as_view()),
    path('api/auth/refresh/', TokenRefreshView.as_view())
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
コード例 #25
0
ファイル: urls.py プロジェクト: drodrz/Brewabl
from django.views.generic import TemplateView
from django.conf.urls import patterns, url

from rest_auth.registration.views import RegisterView, VerifyEmailView
from allauth.account.views import ConfirmEmailView

urlpatterns = patterns(
    '',
    url(r'^$', RegisterView.as_view(), name='rest_register'),
    url(r'^verify-email/$', VerifyEmailView.as_view(), name='rest_verify_email'),

    # 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
    url(r'^account-confirm-email/(?P<key>\w+)/$', ConfirmEmailView.as_view(), name='account_confirm_email'),
)
コード例 #26
0
ファイル: urls.py プロジェクト: Maxbey/socialaggregator
from aggregator.views import SocialPersonViewSet
from aggregator.views import PasswordChangeView

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'),
コード例 #27
0
ファイル: urls.py プロジェクト: kixlab/xproj-backend
from . import views
from prompt_responses.viewsets import PromptViewSet, PromptSetViewSet
from rest_auth.registration.views import RegisterView, VerifyEmailView

router = Router()
router.register(r'areas', AreaViewSet)
router.register(r'people', PersonViewSet)
router.register(r'voting-districts', VotingDistrictViewSet)
router.register(r'promises', PromiseViewSet)
router.register(r'news', ArticleViewSet)
router.register(r'budget-programs', BudgetProgramViewSet)

# External packages
router.register(r'prompts', PromptViewSet)
router.register(r'prompt-sets', PromptSetViewSet)

urlpatterns = [
    url(r'^api/', include(router.urls)),
    url(r'^api/auth/', include('rest_auth.urls')),
    url(r'^api/auth/signup/$', RegisterView.as_view(), name='rest_register'),
    url(r'^api/auth/signup/verify-email/$',
        VerifyEmailView.as_view(),
        name='rest_verify_email'),
    url(r'^oauth/token/', views.TokenView.as_view()),
    url(r'^oauth/success/', views.OAuthSuccessView.as_view()),
    url(r'^oauth/auto-signup/', views.AnnonymousSignupTokenView.as_view()),
    url(r'^oauth/', include('oauth2_provider.urls',
                            namespace='oauth2_provider')),
    #    url(r'^$', RedirectView.as_view(pattern_name='api_root', permanent=False)),
]
コード例 #28
0
from django.conf.urls import url, include
from django.contrib import admin
from django.conf import settings
from django.conf.urls.static import static

from rest_auth.registration.views import RegisterView

urlpatterns = [
    # ADMIN urls
    url(r'^admin/', admin.site.urls),

    # API endpoints
    url(r'^api/v1/auth/', include('rest_auth.urls')),
    url(r'^api/v1/auth/register', RegisterView.as_view()),
    url(r'^api/v1/oauth/', include('apps.users.api.oauth_urls')),
    url(r'^api/v1/', include('apps.users.api.urls')),
    url(r'^users/', include('apps.users.urls')),
]

# for serving uploaded files on dev environment with django
if settings.DEBUG:
    import debug_toolbar
    urlpatterns += static(settings.MEDIA_URL,
                          document_root=settings.MEDIA_ROOT)
    urlpatterns += static(settings.STATIC_URL,
                          document_root=settings.STATIC_ROOT)
    urlpatterns = [
        url(r'^__debug__/', include(debug_toolbar.urls)),
    ] + urlpatterns

# adding urls for demonstration or fake apps
コード例 #29
0
ファイル: urls.py プロジェクト: alushenk/musicroom
         name='password_reset'),
    path('auth/password-reset/confirm/<str:uidb64>/<str:token>/',
         ResCon.as_view(),
         name='password_reset_confirm'),
    path('auth/password-reset/complete/',
         viewsets.password_reset_complete,
         name='password_reset_complete'),

    # URLs that require a user to be logged in with a valid session / token.
    path('auth/user/', UserDetailsView.as_view(), name='user_details'),
    path('auth/password/change/',
         PasswordChangeView.as_view(),
         name='password_change'),

    # same as rest_auth.views, but with
    path('auth/registration/', RegisterView.as_view(), name='register'),
    path('auth/login/', LoginView.as_view(), name='login'),

    # 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:
    # django-allauth https://github.com/pennersr/django-allauth/blob/master/allauth/account/views.py
    path('auth/account-confirm-email/<str:key>/',
         ConfirmEmailView.as_view(),
コード例 #30
0
        PasswordChangeView.as_view(),
        name='rest_password_change',
    ),
    url(
        r'^change-email/(?P<uuid>[^/]+)/$',
        ChangeEmailConfirmationViewSet.as_view(),
        name='change-email-confirmation',
    ),
    url(
        r'^change-email/$',
        ChangeEmailViewSet.as_view(),
        name='change-email',
    ),
    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'^register/$',
        RegisterView.as_view(),
        name='rest_register',
    ),
    url(r'^', include(router.urls)),
]
コード例 #31
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'),
]