예제 #1
0
from django.conf.urls import url, include
from authentication.views import RegistrationAPIView, LoginAPIView, UserListViewSet

urlpatterns = [
    url(r'^users/$',
        UserListViewSet.as_view({'get': 'list'}),
        name='user_list'),
    url(r'^users/register/$', RegistrationAPIView.as_view(), name='register'),
    url(r'^users/login/$', LoginAPIView.as_view(), name='login'),
]
예제 #2
0
from django.urls import path
from rest_framework import routers

from authentication.views import (
    RegistrationAPIView, Activate, LoginAPIView,
    Reset,

)

app_name ="authentication"
urlpatterns = [
    path("users/", RegistrationAPIView.as_view(), name="register"),
    path('activate/<uidb64>/<token>/', Activate.as_view(), name="activate"),
    path('users/login', LoginAPIView.as_view()),
    path("users/reset/<uidb64>/<token>", Reset.as_view(), name="reset")

]
예제 #3
0
from django.urls import path

from authentication.views import (RegistrationAPIView, LoginAPIv2View,
                                  ProfileView, LogoutAPIView,
                                  ValidateOTPAPIView, VerifyAccountAPIView,
                                  RegistrationAPIv2View)

app_name = 'authenticationv2'

urlpatterns = [
    path("subscription/", RegistrationAPIView.as_view(), name="subscription"),
    path("register/", RegistrationAPIv2View.as_view(), name="register"),
    path("logout/", LogoutAPIView.as_view(), name="logout"),
    path("profile/", ProfileView.as_view(), name="profile"),
    path("login/", LoginAPIv2View.as_view(), name="loginv2"),
    path("login/otp/", ValidateOTPAPIView.as_view(), name="otp_validater"),
    path("verify/", VerifyAccountAPIView.as_view(), name="verify_account")
]
예제 #4
0
from django.urls import path

from authentication.views import UserRetrieveUpdateAPIView, RegistrationAPIView, LoginAPIView

app_name = 'authentication'

urlpatterns = [
    path('user/', UserRetrieveUpdateAPIView.as_view(), name='user_details'),
    path('users/', RegistrationAPIView.as_view(), name='sign_up'),
    path('users/login/', LoginAPIView.as_view(), name='login')
]
예제 #5
0
파일: urls.py 프로젝트: sourabh1031/cruzz
# Django
from django.conf.urls import url

# local django
from authentication.views import RegistrationAPIView, LoginAPIView, UserRetrieveUpdateAPIView
from authentication import views

urlpatterns = [
    url(r'^users/registration/?$', RegistrationAPIView.as_view()),
    url(r'^users/login/?$', LoginAPIView.as_view()),
    url(r'^users/update/?$', UserRetrieveUpdateAPIView.as_view()),
    url(r'^activate/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',
        views.activate,
        name='activate'),
]
예제 #6
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, re_path

from authentication.views import RegistrationAPIView, LoginAPIView
from news.views import News, Comments, Upvotes

urlpatterns = [
    path('admin/', admin.site.urls),
    re_path(r'^registration/?$',
            RegistrationAPIView.as_view(),
            name='user_registration'),
    re_path(r'^login/?$', LoginAPIView.as_view(), name='user_login'),
    re_path(r'^news/?$', News.as_view(), name='news'),
    re_path(r'^upvote/?$', Upvotes.as_view(), name='upvote'),
    re_path(r'^comment/?$', Comments.as_view(), name='comment'),
]
from companies import views as company_views
from products import views as product_views
from django.urls import path, include
from django.conf.urls import url

router = routers.DefaultRouter()
router.register(r'categories', category_views.CategoryViewSet, basename="categories")
router.register(r'companies', company_views.CompanyViewSet, basename="companies")
router.register(r'products', product_views.ProductViewSet, basename="products")

schema_view = get_schema_view(
   openapi.Info(
      title="Company API",
      default_version='v1',
      description="REST-API Documentation",
      terms_of_service="https://www.google.com/policies/terms/",
      contact=openapi.Contact(email="*****@*****.**"),
      license=openapi.License(name="BSD License"),
   ),
   public=True,
   permission_classes=(permissions.AllowAny,),
)

urlpatterns = [
    path('', include(router.urls)),
    path('admin/', admin.site.urls),
    url(r'^swagger/$', schema_view.with_ui('swagger', cache_timeout=None), name='schema-swagger-ui'),
    path('log-in/', views.obtain_auth_token, name="login"), # авторизация
    path('sign-up/', RegistrationAPIView.as_view(), name="sign-up") # регистрация
]