Exemplo n.º 1
0
from django.urls import path
from . import views
from hrm.api import UserList, UserDetail
from django.conf.urls import url

urlpatterns = [
    path('', views.homeView.as_view(), name='home'),
    url(r'^api/user_list/$', UserList.as_view(), name='user_list'),
    url(r'^api/user_list/(?P<id>\d+)/$',
        UserDetail.as_view(),
        name='user_list')
]
Exemplo n.º 2
0
from django.contrib import admin
from django.urls import path
from . import views
from django.conf.urls import url
from hrm.api import UserList, UserDetail, UserAuthentication

urlpatterns = [
    path('admin/', admin.site.urls),
    # url(r'^api/users_list/$', UserList.as_view(), name = 'user_list')
    path('', views.index, name='index'),
    path('viewdata/', views.viewdata, name='view_data'),
    path('api/users_list/', UserList.as_view(), name='user_list'),
    url(r'^api/users_list/(?P<employee_id>\d+)/$',
        UserDetail.as_view(),
        name='user_detail'),
    url(r'^api/auth/$',
        UserAuthentication.as_view(),
        name='user_authentication')
]
Exemplo n.º 3
0
"""employee_api 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 
from hrm.api import UserList,UserDetail

urlpatterns = [
    path('admin/', admin.site.urls),
    path('api/users_list/',UserList.as_view(),name="users_list"),
    path('api/users_list/<int:employee_id>',UserDetail.as_view(),name="users_detail"),

]
Exemplo n.º 4
0
"""employee URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/3.1/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
from django.conf.urls import url

from hrm.api import UserList, UserDetail

urlpatterns = [
    path('admin/', admin.site.urls),
    url(r'^api/user_list/$', UserList.as_view(), name="user_list"),
    url(r'^api/user_list/(?P<employee_id>\d+)/$', UserDetail.as_view(), name="user_list")
]