from django.urls import path, include from users.views import CustomAuthToken, Logout urlpatterns = [ path('login/', CustomAuthToken.as_view()), path('logout/', Logout.as_view()), ]
from django.urls import path, include from users.views import CustomAuthToken, Logout, UserData urlpatterns = [ path('login/', CustomAuthToken.as_view(), name="login_link"), path('logout/', Logout.as_view()), path('myname/', UserData.as_view({"get": "retrieve"})) ]
"""coti_construct 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, include from users.views import CustomAuthToken urlpatterns = [ path('admin/', admin.site.urls), path('api-token-auth/', CustomAuthToken.as_view()), path('api/', include('coti.urls', namespace='coti')), ]
admin.autodiscover() urlpatterns = [ path('admin/', admin.site.urls), path('', include('users.urls'), name='users'), path('', include('books.urls'), name='books'), path('docs/', schema_view), ## Authentication Paths ## ## Session path('api-auth/', include('rest_framework.urls')), ## Token path('api/token/custom', CustomAuthToken.as_view(), name=CustomAuthToken.name), ## OAuth path('o/', include('rest_framework_social_oauth2.urls')), path('social/<backend>/', exchange_token), ## JWT path('api/token/jwt/', TokenObtainPairView.as_view(), name='token_obtain_pair'), path('api/token/jwt/refresh/', TokenRefreshView.as_view(), name='token_refresh'), path('api/token/jwt/verify/', TokenVerifyView.as_view(), name='token_verify'), ] if settings.DEBUG: urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
from django.conf.urls import url from django.contrib import admin from django.urls import path, include from rest_framework.authtoken import views from users.views import CustomAuthToken urlpatterns = [ path('api-token-auth/', CustomAuthToken.as_view(), name='api-token auth'), path('admin/', admin.site.urls), path('users/', include('django.contrib.auth.urls')), path('accounts/', include('allauth.urls')), path('', include('pages.urls')), url(r'^advanced_filters/', include('advanced_filters.urls')) ]
"""core 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, include from users.views import CustomAuthToken, UserSignUp, Logout urlpatterns = [ path('admin/', admin.site.urls), path('register/', UserSignUp.as_view(), name='register'), path('login/', CustomAuthToken.as_view(), name='login'), path('logout/', Logout.as_view(), name='logout'), path('api/', include('market.urls')), path('api-auth/', include('rest_framework.urls')), ]
router = DefaultRouter() #images router.register(r'api/(?P<version>[v1|v2]+)/image',ImageViewSet,base_name="image") #file router.register(r'api/(?P<version>[v1|v2]+)/file',FileViewSet,base_name="file") #短信验证码生成 router.register(r'api/(?P<version>[v1|v2]+)/codes', EmailCodeViewset, base_name="codes") #用户注册 router.register(r'api/(?P<version>[v1|v2]+)/users', UserViewset, base_name="users") schema_view = get_swagger_view(title="FDSops") urlpatterns = [ url(r'^xadmin/', xadmin.site.urls), url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')), #文档 url(r'docs/',include_docs_urls(title="FDSops")), #token的认证接口 url(r'^api-token-auth/', CustomAuthToken.as_view()), #图片列表 url(r'^',include(router.urls)), #图片切割 url(r'^group(?P<gid>[0-9])/(?P<fileid>.+)!(?P<parameter>.+)',HandleImagesApi.as_view()), #打开图片 url(r'^group(?P<gid>[0-9])/(?P<fileid>.+)',OpenFdfsImage.as_view()), ]
from django.conf.urls import url from users.views import login_view, logout_view, CustomAuthToken urlpatterns = [ url("token/", CustomAuthToken.as_view(), name="token_obtain"), url("login/", login_view, name="login"), url("logout/", logout_view, name="logout"), ]
from django.conf.urls import url from django.contrib import admin from django.urls import path, include from rest_framework.authtoken.views import obtain_auth_token from users.views import CustomAuthToken urlpatterns = [ path('admin/', admin.site.urls), path('api/', include('backend.urls')), path('auth/', CustomAuthToken.as_view()), path('api-auth/', include('rest_framework.urls')), ]
url(r'^api/v1/docs/$', schema_view.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'), url(r'^api/v1/autocomplete/(?P<search_text>.+)', searchAutoComplete.as_view(), name='search_autocomplete'), url(r'^api/v1/search/(?P<q>.+)', search_any, name='search'), url(r'^api/v1/directions/', include(('routing.urls', 'directions'), namespace='directions')), url(r'^api/v1/admin/', admin.site.urls), url(r'^api/v1/poi/', include(('poi_manager.urls', 'poi'), namespace='poi')), url(r'^api/v1/', include(router.urls)) ] urlpatterns += [url(r'^api/v1/api-token-auth/', CustomAuthToken.as_view())] urlpatterns += [ # ... the rest of your URLconf goes here ... ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) if 'rosetta' in settings.INSTALLED_APPS: urlpatterns += [ url(r'^translate/', include('rosetta.urls')), ] ############################################## # Static and media files in debug mode ############################################## if settings.DEBUG: