Answers for "_reverse_with_prefix() argument after * must be an iterable, not int"

1

_reverse_with_prefix() argument after * must be an iterable, not int

#For this example:
scores_url = reverse('get_scores', args=(obj.pk))

#putting a comma at the end of the args tuple fixes it.
scores_url = reverse('get_scores', args=(obj.pk,))

#Alternatively, as mentioned in the docs, using a list would work fine:
scores_url = reverse('get_scores', args=[obj.pk])
Posted by: Guest on September-27-2021

Code answers related to "_reverse_with_prefix() argument after * must be an iterable, not int"

Python Answers by Framework

Browse Popular Code Answers by Language