@@ -41,32 +41,32 @@ URL this view will respond to:
41
41
42
42
# OAuth2 provider endpoints
43
43
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" ),
47
47
]
48
48
49
49
if settings.DEBUG :
50
50
# OAuth2 Application Management endpoints
51
51
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" ),
57
57
]
58
58
59
59
# OAuth2 Token Management endpoints
60
60
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(),
63
63
name = " authorized-token-delete" ),
64
64
]
65
65
66
66
urlpatterns = [
67
67
# 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
70
70
]
71
71
72
72
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