Ejemplo n.º 1
0
from django.urls import path, include
from rest_framework.urlpatterns import format_suffix_patterns
from users.views import UserCreateAPIView, UserLoginAPIView
app_name = "users"

urlpatterns = {
    path('login/', UserLoginAPIView.as_view(), name="login"),
    path('register/', UserCreateAPIView.as_view(), name="register"),
}

urlpatterns = format_suffix_patterns(urlpatterns)
Ejemplo n.º 2
0
from django.urls import include, path
from rest_framework.routers import DefaultRouter

from users.views import (UserViewSet, UserLoginAPIView, UserSignUpAPIView)

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

urlpatterns = [
    path('users/login/', UserLoginAPIView.as_view(), name='login'),
    path('users/signup/', UserSignUpAPIView.as_view(), name='signup'),
    path('', include(router.urls))
]
Ejemplo n.º 3
0
from django.conf.urls import url
from users.views import UserRegistrationAPIView, UserLoginAPIView, UserLogoutAPIView

urlpatterns = [
    url(r'^$', UserRegistrationAPIView.as_view(), name="list"),
    url(r'^login/$', UserLoginAPIView.as_view(), name="login"),
    url(r'^logout/$', UserLogoutAPIView.as_view(), name="logout"),
]
router.register(r'django/employees', EmployeeViewset, basename="employees")
router.register(r'django/employees-list', EmployeeListViewset, basename="employees-list")

router.register(r'django/merchants', MerchantViewset, basename="merchants")
router.register(r'django/merchants-list', MerchantListViewset, basename="merchants-list")

router.register(r'django/superusers', SuperUserViewset, basename="superusers")
router.register(r'django/superusers-list', SuperUserListViewset, basename="superusers-list")

router.register(r'django/users', UserViewset, basename="users-profile")
router.register(r'django/users-list', UserListViewset, basename="users-list")

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

    #Login & Logout
    path('django/login/', UserLoginAPIView.as_view(), name='login'),
		path('django/logout/', UserLogOutAPIView.as_view(), name='logout'),    

    #Registered Router APIView Routes
    path('', include(router.urls)),

    #API Links
    url(r'^api/', include((router.urls, 'app_name'),
                          namespace='instance_name')),
    url(r'^api/accounts/', include('rest_registration.api.urls')),
    url(r'^api/auth/',
        include('rest_framework.urls', namespace='rest_framework')),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Ejemplo n.º 5
0
from django.urls import path
from users.views import UserRegistrationAPIView, UserLoginAPIView, UserTokenAPIView

app_name = 'users'

urlpatterns = [
    path('users/', UserRegistrationAPIView.as_view(), name="list"),
    path('users/login/', UserLoginAPIView.as_view(), name="login"),
    path('tokens/<key>/', UserTokenAPIView.as_view(), name="token"),
]
Ejemplo n.º 6
0
from django.urls import path
from users.views import UserList , UserDetail , UserSignupAPIView , UserLoginAPIView

app_name = 'users'

urlpatterns = [
    path(r'users/', UserList.as_view()),
    path(r'users/<int:id>/', UserDetail.as_view()),
    path(r'users/register/', UserSignupAPIView.as_view()),
    path(r'users/login/', UserLoginAPIView.as_view()),
]
Ejemplo n.º 7
0
from django.urls import path
from users.views import UserRegistrationAPIView, UserChangeEmailAPIView, UserDeletionAPIView, UserInfoAPIView, UserLoginAPIView
from users.views import UserLogoutAPIView

urlpatterns = [
	path('users/register', UserRegistrationAPIView.as_view()),
	path('users/<int:pk>/change_email', UserChangeEmailAPIView.as_view(), name='change email'),
	path('users/<int:pk>/delete', UserDeletionAPIView.as_view(), name='delete user'),
	path("users/<int:pk>/info", UserInfoAPIView.as_view(), name="user info"),
	path("users/login", UserLoginAPIView.as_view(), name="user login"),
	path("users/logout", UserLogoutAPIView.as_view(), name="user logout")
]
Ejemplo n.º 8
0
from django.conf.urls import url
from django.contrib import admin
from users.views import UserCreateAPIView,UserLoginAPIView

app_name = 'users'

urlpatterns = [
    url(r'^login/$', UserLoginAPIView.as_view(), name='login'),
    url(r'^register/$', UserCreateAPIView.as_view(), name='register'),

]
Ejemplo n.º 9
0
from django.urls import path
from users.views import UserRegistrationAPIView, UserLoginAPIView, UserTokenAPIView

app_name = 'users'

urlpatterns = [
    path(r'users/', UserRegistrationAPIView.as_view(), name="list"),
    path(r'users/login/', UserLoginAPIView.as_view(), name="login"),
    path(r'tokens/<key>/', UserTokenAPIView.as_view(), name="token"),
]
Ejemplo n.º 10
0
"""farmer URL Configuration

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 users.views import (
    UserLoginAPIView, )

urlpatterns = [
    path('admin/', admin.site.urls),
    path('api/v1', UserLoginAPIView.as_view(), name="api/v1"),
]