@@ -41,32 +41,32 @@ URL this view will respond to:
4141
4242 # OAuth2 provider endpoints
4343 oauth2_endpoint_views = [
44- url( r ' ^ authorize/$ ' , oauth2_views.AuthorizationView.as_view(), name = " authorize" ),
45- url( r ' ^ token/$ ' , oauth2_views.TokenView.as_view(), name = " token" ),
46- url( r ' ^ revoke-token/$ ' , oauth2_views.RevokeTokenView.as_view(), name = " revoke-token" ),
44+ path( ' authorize/' , oauth2_views.AuthorizationView.as_view(), name = " authorize" ),
45+ path( ' token/' , oauth2_views.TokenView.as_view(), name = " token" ),
46+ path( ' revoke-token/' , oauth2_views.RevokeTokenView.as_view(), name = " revoke-token" ),
4747 ]
4848
4949 if settings.DEBUG :
5050 # OAuth2 Application Management endpoints
5151 oauth2_endpoint_views += [
52- url( r ' ^ applications/$ ' , oauth2_views.ApplicationList.as_view(), name = " list" ),
53- url( r ' ^ applications/register/$ ' , oauth2_views.ApplicationRegistration.as_view(), name = " register" ),
54- url( r ' ^ applications/( ?P <pk>\d + ) / $ ' , oauth2_views.ApplicationDetail.as_view(), name = " detail" ),
55- url( r ' ^ applications/( ?P <pk>\d + ) /delete/$ ' , oauth2_views.ApplicationDelete.as_view(), name = " delete" ),
56- url( r ' ^ applications/( ?P <pk>\d + ) /update/$ ' , oauth2_views.ApplicationUpdate.as_view(), name = " update" ),
52+ path( ' applications/' , oauth2_views.ApplicationList.as_view(), name = " list" ),
53+ path( ' applications/register/' , oauth2_views.ApplicationRegistration.as_view(), name = " register" ),
54+ path( ' applications/<pk>/ ' , oauth2_views.ApplicationDetail.as_view(), name = " detail" ),
55+ path( ' applications/<pk>/delete/' , oauth2_views.ApplicationDelete.as_view(), name = " delete" ),
56+ path( ' applications/<pk>/update/' , oauth2_views.ApplicationUpdate.as_view(), name = " update" ),
5757 ]
5858
5959 # OAuth2 Token Management endpoints
6060 oauth2_endpoint_views += [
61- url( r ' ^ authorized-tokens/$ ' , oauth2_views.AuthorizedTokensListView.as_view(), name = " authorized-token-list" ),
62- url( r ' ^ authorized-tokens/( ?P <pk>\d + ) /delete/$ ' , oauth2_views.AuthorizedTokenDeleteView.as_view(),
61+ path( ' authorized-tokens/' , oauth2_views.AuthorizedTokensListView.as_view(), name = " authorized-token-list" ),
62+ path( ' authorized-tokens/<pk>/delete/' , oauth2_views.AuthorizedTokenDeleteView.as_view(),
6363 name = " authorized-token-delete" ),
6464 ]
6565
6666 urlpatterns = [
6767 # OAuth 2 endpoints:
68- url( r ' ^ o/' , include(oauth2_endpoint_views, namespace = " oauth2_provider" )),
69- url( r ' ^ api/hello' , ApiEndpoint.as_view()), # an example resource endpoint
68+ path( ' o/' , include(oauth2_endpoint_views, namespace = " oauth2_provider" )),
69+ path( ' api/hello' , ApiEndpoint.as_view()), # an example resource endpoint
7070 ]
7171
7272 You will probably want to write your own application views to deal with permissions and access control but the ones packaged with the library can get you started when developing the app.
0 commit comments