Django Reverse with arguments '()' and keyword arguments '{}' not found
The solution @miki725 is absolutely correct. Alternatively, if you would like to use the args
attribute as opposed to kwargs
, then you can simply modify your code as follows:
project_id = 4
reverse('edit_project', args=(project_id,))
An example of this can be found in the documentation. This essentially does the same thing, but the attributes are passed as arguments. Remember that any arguments that are passed need to be assigned a value before being reversed. Just use the correct namespace, which in this case is 'edit_project'
.
You have to specify project_id
:
reverse('edit_project', kwargs={'project_id':4})
Doc here