"""REsFramework URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-based views 1. Add an import: from other_app.views import Home 2. Add a URL to urlpatterns: url(r'^$', Home.as_view(), name='home') Including another URLconf 1. Import the include() function: from django.conf.urls import url, include 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) """ from django.conf.urls import url, include from django.contrib import admin from updates.views import json_example_view, JsonCBV, JsonCBV2 # from rest_framework_jwt.views import refresh_jwt_token , obtain_jwt_token urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^json-example/$', json_example_view), url(r'^JsonCBV/$', JsonCBV.as_view(), name='JsonCBV'), url(r'^JsonCBV2/$', JsonCBV2.as_view(), name='JsonCBV2'), url(r'^api/auth/', include('accounts.api.urls')), url(r'^api/status/', include('status.api.urls')), # url(r'^api/jwt-token/$', obtain_jwt_token), # url(r'^api/jwt-refresh-token/$', refresh_jwt_token), ]
StatusAPIDetailView) from rest_framework_jwt.views import obtain_jwt_token, refresh_jwt_token from accounts.api.views import AuthView, RegisterView, RegisterAPIView from accounts.api.user.views import UserDetailAPIView, UserStatusAPIView urlpatterns = [ path('admin/', admin.site.urls), url(r'^api/updates/$', include('updates.api.urls')), url(r'^api/auth/jwt/$', obtain_jwt_token), url(r'^api/auth/jwt/refresh/$', refresh_jwt_token), url(r'^api/auth/$', AuthView.as_view()), url(r'^api/auth/register/$', RegisterView.as_view()), url(r'^api/auth/apiregister/', RegisterAPIView.as_view()), url(r'^api/status/$', include('status.api.urls')), # url(r'^$', update_model_detail_view ), url(r'^json/cbv/$', JsonCBV.as_view()), url(r'^json/cbv2/$', JsonCBV2.as_view()), url(r'^json/serialized/details/$', SerializeDetailView.as_view()), url(r'^json/serialized/list/$', SerializeListView.as_view()), url(r'^api/updates/(?P<id>\d+)/$', UpdateModelDetailAPIView.as_view()), #url(r'^api/status/(?P<pk>\d+)/$', StatusDetailAPIView.as_view()), url(r'^api/status/(?P<pk>\d+)/$', StatusAPIDetailView.as_view()), url(r'^api/status/(?P<pk>\d+)/update$', StatusUpdateAPIView.as_view()), url(r'^api/status/(?P<pk>\d+)/delete$', StatusDeleteAPIView.as_view()), url(r'^api/user/(?P<username>\w+)/$', UserDetailAPIView.as_view(), name="details"), url(r'^api/user/(?P<username>\w+)/status$', UserStatusAPIView.as_view()), ]
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 updates.views import( json_example_view, JsonCBV, JsonCBV2, SerializedListView, SerializedDetailedView, ) urlpatterns = [ path('admin/', admin.site.urls), path('json/example', json_example_view), path('json/cbv', JsonCBV.as_view()), path('json/cbv2', JsonCBV2.as_view()), path('json/serialized/detail', SerializedDetailedView.as_view()), path('json/serialized/list', SerializedListView.as_view()), ]
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 updates.views import ( json_http_example_view, json_response_example_view, JsonCBV, JsonCBV2, SerializedListView, SerializedDetialView ) urlpatterns = [ path('admin/', admin.site.urls), url('json/example/1', json_http_example_view), url('json/example/2', json_response_example_view), url('json/example/CBV', JsonCBV.as_view()), url('json/example/CBV2', JsonCBV2.as_view()), url('json/serialized/list', SerializedListView.as_view()), url('json/serialized/one', SerializedDetialView.as_view()), ]
from django.conf.urls import url from django.contrib import admin from updates.views import ( update_model_detail_view, JsonCBV, JsonCBV2, SerializedListView, SerializedDetailView, ) urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^json/$', update_model_detail_view), url(r'^json/example1/$', JsonCBV.as_view()), url(r'^json/detail/$', SerializedDetailView.as_view()), url(r'^json/list/$', SerializedListView.as_view()), ]
from django.contrib import admin from django.urls import path from updates.views import json_example_view, JsonCBV, JsonCBV2 urlpatterns = [ path('admin/', admin.site.urls), path('', json_example_view), path('cbv/', JsonCBV.as_view()), path('cbv2/', JsonCBV2.as_view()) ]
from django.conf.urls import url from django.urls import include from updates.views import ( json_example_view, JsonCBV, JsonCBV2, SerializedListView, SerializedDetailView, ) urlpatterns = [ url(r'^$', json_example_view), url(r'example/', json_example_view), url(r'cbv/', JsonCBV.as_view()), url(r'cbv2/', JsonCBV2.as_view()), url(r'serialize/', SerializedListView.as_view()), url(r'serialize-detail/', SerializedDetailView.as_view()) ]