Whats the correct way to use and refer to a slugfield in a django 1.3
for example the following code should link via slug to a generic view however the NoReverseMatch er
A slug value can contain any a-z
, A-Z
, 0-9
, _
and -
. The first 3 are represented by the special character w
and since -
itself is a special character, we need to use represent them both using a backslash \
. So the correct expression becomes
url(r'^post/(?P[\w\-]+)/$', ...
At least this is what is working in my case.