Skip to content

Conversation

@dmitrijBerg
Copy link

Motivation

Following part 6 of the tutorial, I encountered following error:

Could not resolve URL for hyperlinked relationship using view name "user-detail". You may have failed to include the related model in your API, or incorrectly configured the `lookup_field` attribute on this field.

After some debugging I tracked the problem down to two lines of code at the very end.

Description

The basename values users and snippets break the automatic creation of urlpatterns. Instead, it should be user and snippet.

The basenames `users` and `snippets` break the automatic creation of urlpatterns. Instead, it should be `user` and `snippet`.
@lovelydinosaur
Copy link
Contributor

lovelydinosaur commented Jun 8, 2022

Resolved in #8517

(And ooops, yes I see that this one came first, thanks anyway)

@dmitrijBerg dmitrijBerg deleted the patch-1 branch June 11, 2022 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants