Skip to content

Reverse for ' ' with arguments ' ' not found. 1 pattern(s) tried: ['(?P<pk>[0-9]+)$'] #21452

Answered by am-giordano
legkoszkur asked this question in General
Discussion options

You must be logged in to vote

The problem is that you first intended to pass a tuple to args, but you actually didn’t.

When creating a tuple with a single element you must add a comma after the element to indicate it is indeed a tuple. Otherwise the parenthesis would have the usual purpose of enclosing information (x is (x)).

Therefore, in your case you should use: args=(str(self.id),). But of course your solution of passing a list instead is equally valid.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants