Showing
1 changed file
with
37 additions
and
37 deletions
1 | -"""khudrive URL Configuration | 1 | +"""khudrive URL Configuration |
2 | - | 2 | + |
3 | -The `urlpatterns` list routes URLs to views. For more information please see: | 3 | +The `urlpatterns` list routes URLs to views. For more information please see: |
4 | - https://docs.djangoproject.com/en/3.0/topics/http/urls/ | 4 | + https://docs.djangoproject.com/en/3.0/topics/http/urls/ |
5 | -Examples: | 5 | +Examples: |
6 | -Function views | 6 | +Function views |
7 | - 1. Add an import: from my_app import views | 7 | + 1. Add an import: from my_app import views |
8 | - 2. Add a URL to urlpatterns: path('', views.home, name='home') | 8 | + 2. Add a URL to urlpatterns: path('', views.home, name='home') |
9 | -Class-based views | 9 | +Class-based views |
10 | - 1. Add an import: from other_app.views import Home | 10 | + 1. Add an import: from other_app.views import Home |
11 | - 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') | 11 | + 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') |
12 | -Including another URLconf | 12 | +Including another URLconf |
13 | - 1. Import the include() function: from django.urls import include, path | 13 | + 1. Import the include() function: from django.urls import include, path |
14 | - 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) | 14 | + 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) |
15 | -""" | 15 | +""" |
16 | -from django.urls import include, path | 16 | +from django.urls import include, path |
17 | -from rest_framework import routers | 17 | +from rest_framework import routers |
18 | -from django.contrib import admin | 18 | +from django.contrib import admin |
19 | -from api import views | 19 | +from api import views |
20 | -from django.conf.urls import url | 20 | +from django.conf.urls import url |
21 | - | 21 | + |
22 | -router = routers.DefaultRouter() | 22 | +router = routers.DefaultRouter() |
23 | -router.register(r'users', views.UserViewSet) | 23 | +router.register(r'users', views.UserViewSet) |
24 | -router.register(r'items', views.ItemViewSet) | 24 | +router.register(r'items', views.ItemViewSet) |
25 | -router.register(r'items', views.SharedItemViewSet) | 25 | +router.register(r'items', views.SharedItemViewSet) |
26 | - | 26 | + |
27 | -# Wire up our API using automatic URL routing. | 27 | +# Wire up our API using automatic URL routing. |
28 | -# Additionally, we include login URLs for the browsable API. | 28 | +# Additionally, we include login URLs for the browsable API. |
29 | -urlpatterns = [ | 29 | +urlpatterns = [ |
30 | - path('admin/', admin.site.urls), | 30 | + path('admin/', admin.site.urls), |
31 | - path('', include(router.urls)), | 31 | + path('', include(router.urls)), |
32 | - url(r'^search/$', views.ItemViewSet.search, name='search'), | 32 | + url(r'^signup/$', views.UserViewSet.signup, name='signup'), |
33 | - url(r'^<int:pk>/share/$', views.SharedItemViewSet.share, name='share'), | 33 | + url(r'^login/$', views.UserViewSet.login, name='login'), |
34 | - url(r'^<int:pk>/move/$', views.ItemViewSet.move, name='move'), | 34 | + url(r'^renew/$', views.UserViewSet.renew, name='renew'), |
35 | - url(r'^<int:pk>/copy/$', views.ItemViewSet.copy, name='copy'), | 35 | + url(r'^<int:pk>/info/$', views.UserViewSet.info, name='info'), |
36 | - | 36 | + path('api-auth/', include('rest_framework.urls', namespace='rest_framework')), |
37 | -] | 37 | +] | ... | ... |
-
Please register or login to post a comment