Skip to content

Commit 671bfda

Browse files
aryaniyapsauvipy
authored andcommitted
update namespace error in example
Because the app_name attribute is not set in the included module (oauth2_provider), we cannot directly include endpoints with the namespace oauth2_provider. We need to pass in a tuple of the endpoints and app-name instead. Document the same in the tutorial example.
1 parent cc767e4 commit 671bfda

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/tutorial/tutorial_02.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ URL this view will respond to:
6565
6666
urlpatterns = [
6767
# OAuth 2 endpoints:
68-
path('o/', include(oauth2_endpoint_views, namespace="oauth2_provider")),
68+
# need to pass in a tuple of the endpoints as well as the app's name
69+
# because the app_name attribute is not set in the included module
70+
path('o/', include((oauth2_endpoint_views, 'oauth2_provider'), namespace="oauth2_provider")),
6971
path('api/hello', ApiEndpoint.as_view()), # an example resource endpoint
7072
]
7173

0 commit comments

Comments
 (0)