开发者

NoReverseMatch with Django-survey?

Ok, so this works in my urls.py:

url(r'^', survey_detail, {'survey_slug':'my-survey'},  name='survey-detail'),

I removed the above line and want to put the link in a template using {% url %}

I have the following line in urls.py:

url(r'^survey/', include('survey.urls'),

This is the line from the urls.py of the Survey app:

url(r'^detail/(?P<survey_slug>[-\w]+)/$', survey_detail,   name='开发者_如何转开发survey-detail'),

And this in my template:

{% url survey_detail 'my-survey' %}

I have also tried:

{% url survey_detail survey_slug='my-survey' %}

But I always get:

Reverse for 'survey_detail' with arguments '(u'my-survey',)' and keyword arguments '{}' not found.

or

Reverse for 'survey_detail' with arguments '()' and keyword arguments '{'survey_slug': u'my-survey'}' not found.

Any ideas?


The name is survey-detail and not survey_detail

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜