2011-08-17 14 views
3

urlタグを使用してビューにリンクしようとしたときにこのエラーが発生しました。エラーは次の行に発生します。Django URL - レンダリング中にNoReverseMatchが発生しました

{% for algorithim in algorithims %} 

テンプレート内です。

どこが間違っているのか分かりません。私は必要な情報をすべて添付していると思いますが、何か他のものを見る必要がある場合はお知らせください。

エラー:

TemplateSyntaxError at /wiki/algorithims/ 
Caught NoReverseMatch while rendering: Reverse for 'wiki.views.algorithim.view' with arguments '(0,)' and keyword arguments '{}' not found. 

url.conf(ウィキ):

from django.conf.urls.defaults import * 

    urlpatterns = patterns('wiki.views', 
     url(r'^$', 'index'), 
     url(r'^algorithims/$', 'algorithims.index'), 
     url(r'^algorithims/(?P<alg_id>\d+)/$', 'algorithims.view') 
    ) 

wiki.views.algorithim:

@login_required 
def index(request): 
    algorithims = Algorithms.objects.all() 
    return render_to_response('wiki/algorithims/index.html', 
          {'algorithims': algorithims 
          }, 
          context_instance=RequestContext(request)) 

テンプレート/ウィキ/ algorithims/index.htmlを:

{% extends "wiki/base.html" %} 

{% block content %} 
<div> 
    {% if algorithims %}  
     {% for algorithim in algorithims %} 
      <a href="{% url wiki.views.algorithim.view algorithim.alg_id %}">{{ algorithim.alg_name }}</a> 
     {% endfor %} 
    {% else %} 
     No algorithims found! 
    {% endif %} 
</div> 
{% endblock %} 
+0

FYP、それはあなたに感謝し、 "アルゴリズム"、ではない "的アルゴリズム" – ThiefMaster

+0

おっと、愚かな私にその –

答えて

2

あなたのビューがのURLconfにalgorithms.viewと呼ばれていますがすなわちsせずに、algorithm.viewとしてURLタグでそれに言及しました。

+0

うわに感謝です! –

関連する問題