I have the following code in my Django template:
<a href="{% url myapp.views.myview foobar %}">
so, what’s the right way to handle the situation where “foobar” contains an asterisk (for example, “*1234”)? At the moment, Django is throwing this error:
Caught NoReverseMatch while rendering: Reverse for 'myapp.views.myview.myview'
with arguments '(u'*86743',)' and keyword arguments '{}' not found.
Commonly, You’d see this if you’re specifying a url rule with a \w regex. For example:
(r'^myview/(?P<myparam>\w.+)/$', 'myview')would cause this. Broadening the regex a bit to allow the ampersand should cure your ills.