Exemplo n.º 1
0
from django.conf.urls import url

from api.views import LoginAPIView, TestRequiredToken

urlpatterns = [
    url(r'^/login', LoginAPIView.as_view()),
    url(r'^/test', TestRequiredToken.as_view()),
]
Exemplo n.º 2
0
      QuestionCreateView.as_view(),
      name='api-question-create'),
 path('question/delete/<int:question_id>/',
      QuestionDeleteView.as_view(),
      name='api-question-delete'),
 path('answer/list/<int:question_id>/',
      AnswerListView.as_view(),
      name='api-answer_list'),
 path('answer/create/',
      AnswerCreateView.as_view(),
      name='api-answer-create'),
 path('answer/delete/<int:answer_id>/',
      AnswerDeleteView.as_view(),
      name='api-answer-delete'),
 path('register/', UserRegisterView.as_view(), name='api-register'),
 path('login/', LoginAPIView.as_view(), name='api-login'),
 path('follow/category/',
      FollowCategoryCreateView.as_view(),
      name='api-follow-category'),
 path('follow/category/list/<int:category_id>/',
      FollowCategoryListView.as_view(),
      name='api-follow-category-list'),
 path('followed/categories/list/<int:follower_id>/',
      FollowedCategoriesListView.as_view(),
      name='api-followed-categories-list'),
 path('follow/question/',
      FollowQuestionCreateView.as_view(),
      name='api-follow-question'),
 path('follow/question/list/<int:question_id>/',
      FollowQuestionListView.as_view(),
      name='api-follow-question-list'),
Exemplo n.º 3
0
         views.create_item,
         name="create_item"),
    path('favorite/<int:restaurant_id>/', views.favorite, name='favorite'),
    path('list/', RestaurantListAPIView.as_view(), name="list"),
    path('detail/<int:restaurant_id>/',
         RestaurantDetailAPIView.as_view(),
         name="detail"),
    path('deleteapi/<int:restaurant_id>/',
         RestaurantDeleteAPIView.as_view(),
         name="deleteapi"),
    path('create/', RestaurantCreateAPIView.as_view(), name="create"),
    path('updateapi/<int:restaurant_id>/',
         RestaurantUpdateAPIView.as_view(),
         name="updateapi"),
    path('item/createapi/<int:restaurant_id>/',
         ItemCreateAPIView.as_view(),
         name="itemcreateapi"),
    path('api/register/', UserRegisterView.as_view(), name="api-register"),
    path('api/login/', LoginAPIView.as_view(), name="api-login"),
]

# path('burgermenu_list_page/', views.burger_menu_list),

if settings.DEBUG:
    urlpatterns += static(settings.STATIC_URL,
                          document_root=settings.STATIC_ROOT)
    urlpatterns += static(settings.MEDIA_URL,
                          document_root=settings.MEDIA_ROOT)

# you choose whatever url you want. views."the_function_defined_in_the views_file"
# you import the views file from the app
Exemplo n.º 4
0
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 import settings
from django.conf.urls.static import static
from api.views import BookListAPIView, BookRatingCreateView, BookDetailAPIView, BookCreateAPIView, PageCreateAPIView, UserCreateAPIView, LoginAPIView

urlpatterns = [
    path('admin/', admin.site.urls),
    path('api/list/', BookListAPIView.as_view()),
    path('api/detail/<int:page_id>/',
         BookDetailAPIView.as_view(),
         name="api_detail"),
    path('api/create/', BookCreateAPIView.as_view()),
    path('api/page_create/', PageCreateAPIView.as_view()),
    path('api/register/', UserCreateAPIView.as_view(), name='api_register'),
    path('api/login/', LoginAPIView.as_view(), name='api_login'),
    path('api/rating/<int:page_id>/',
         BookRatingCreateView.as_view(),
         name="api_rating"),
]
Exemplo n.º 5
0
from django.urls import path
from api.views import RegistrationAPIView, LoginAPIView, LogoutAPIView, TaskList, TaskDetails, Execution

urlpatterns = [
    path('registration/', RegistrationAPIView.as_view()),
    path('login/', LoginAPIView.as_view()),
    path('logout/', LogoutAPIView.as_view()),
    path('todo/', TaskList.as_view()),
    path('todo/<int:pk>', TaskDetails.as_view()),
    path('execution/', Execution.as_view())
]
Exemplo n.º 6
0
from django.conf.urls import include, url
from rest_framework.urlpatterns import format_suffix_patterns
from rest_framework import serializers, viewsets, routers
from rest_framework.urlpatterns import format_suffix_patterns

from api.views import (
    LoginAPIView,
    IntrospectAPIView,
    RegisterAPIView,
    UserListCreateAPIView,
    UserRetrieveUpdateDestroyAPIView
)


urlpatterns = [
    url(r'^api/login$', LoginAPIView.as_view(), name='mikaid_login_api_endpoint'),
    url(r'^api/introspect$', IntrospectAPIView.as_view(), name='mikaid_introspect_api_endpoint'),
    url(r'^api/register$', RegisterAPIView.as_view(), name='mikaid_register_api_endpoint'),
    url(r'^api/users$', UserListCreateAPIView.as_view(), name='mikaid_user_list_create_api_endpoint'),
    url(r'^api/user/(?P<pk>[^/.]+)/$', UserRetrieveUpdateDestroyAPIView.as_view(), name='mikaid_user_retrieve_update_destroy_api_endpoint'),
]


# urlpatterns = format_suffix_patterns(urlpatterns)
Exemplo n.º 7
0
from django.urls import path
from rest_framework_jwt.views import ObtainJSONWebToken, obtain_jwt_token

from api.views import UserDetailAPIView, LoginAPIView, ComputerListAPIView

urlpatterns = [
    path("login/", ObtainJSONWebToken.as_view()),
    path("detail/", UserDetailAPIView.as_view()),
    path("user/", LoginAPIView.as_view()),
    path("com/", ComputerListAPIView.as_view()),
]
Exemplo n.º 8
0
from django.urls import path, include

from api.views import LoginAPIView, LogoutAPIView, LogoutAllAPIView

app_name = 'api'

urlpatterns = [
    path('staff/', include('staff.urls', namespace='staff')),
    path('admin/', include('admin.urls', namespace='admin')),
    path('login', LoginAPIView.as_view(), name='login'),
    path('logout', LogoutAPIView.as_view(), name='logout'),
    path('logout/all', LogoutAllAPIView.as_view(), name='logout_all'),
    path('', include('hospital.urls', namespace='hospital')),
    path('', include('device.urls', namespace='device')),
    path('account/', include('account.urls', namespace='account')),

    # deprecated
    path('', include('api.deprecated_urls'))  # pragma: no cover
]
Exemplo n.º 9
0
from django.urls import path, include
from api.views import UserViewDetail, RegistrationAPIView, LoginAPIView, ResetPassword, UserListView
from rest_framework import routers

router = routers.DefaultRouter(trailing_slash=False)
router.register(r'reset', ResetPassword, basename="token-gen")

urlpatterns = [
    path('', include(router.urls)),
    path('user/<int:uid>', UserViewDetail.as_view()),
    path('user/signup', RegistrationAPIView.as_view()),
    path('user/signin', LoginAPIView.as_view()),
    path('user', UserListView.as_view()),
]
Exemplo n.º 10
0
    path("favorite/<int:rest_id>/", views.favorite, name="favorite"),
    path("list/", RestaurantListAPIView.as_view()),
    path("detail/<int:rest_id>/",
         RestaurantDetailAPIView.as_view(),
         name="api-detail"),
    path("deleteit/<int:rest_id>/",
         RestaurantDeleteAPIView.as_view(),
         name="api-delete"),
    path(
        "createit/",
        RestaurantCreateAPIView.as_view(),
    ),
    path("updateit/<int:rest_id>/",
         RestaurantUpdateAPIView.as_view(),
         name="api-update"),
    path("create/item/<int:rest_id>/",
         ItemCreateAPIView.as_view(),
         name="api-create-item"),
    path("list/item/<int:rest_id>/",
         ItemListAPIView.as_view(),
         name="api-list-item"),
    path("registerit/", UserRegisterView.as_view(), name="api-register"),
    path("loginit/", LoginAPIView.as_view(), name="api-login"),
]

if settings.DEBUG:
    urlpatterns += static(settings.STATIC_URL,
                          document_root=settings.STATIC_ROOT)
    urlpatterns += static(settings.MEDIA_URL,
                          document_root=settings.MEDIA_ROOT)