如何在django中使用{%url%}标记

时间:2016-03-12 18:18:55

标签: django django-templates

Screenshot 1

我在django应用程序中使用url标记时收到此错误dictionary update sequence element #0 has length 1; 2 is required。为什么呢?

<a href="{% url 'Review.AddBook' %}">ADD BOOK</a> my url code

url(regex=r'^AddBook/$',view='views.AddBook',name='Review.AddBook'), # my url code

//My view function
def AddBook(request):
    c={'page_title':Constants.addBookTitle,'form':BookInfoForm()}
    c['booktypes']=Business.BookInformation().GetBookType()
    return render_to_response('AddBook.html',context=c,context_instance=RequestContext(request)

0 个答案:

没有答案