Help me please to fix urls.py People suggested this way, but it does't work for me.....
#urls.py
(r'^/user/(?P<username>)/subject/([\w|\W]+)/$', subject),
#template
{% for subject in subjects %}
<li><a href="/user/{{ user.username }}/subject/{{ subject.name }}">{{ subject.name }}</a> {{ del_form.delete }}</li>
{% endfor %}
#error
PAGE NOT FOUND
Request URL: http://127.0.0.1:8000/user/root/subject/Math%20140
....
....
^/user/(?P<username>)/subject/([\w|\W]+)/$
/, and your test URL (127.0.0.1....MATH%20140) does not end in a/. You could make it optional or remove it. Also,[\w|\W]+should be[\w\W]+since|doesn't mean anything in the[]. (Why not just do.+then? You are including new lines in[\w\W]whereas.does not)slugifyfilter (and attempting to invert in the view - probably best to just add an actualSlugFieldto avoid difficulties there).