Django release 1.5: 'url' requires a non-empty first argument. The syntax changed in Django 1.5

后端 未结 6 426
遥遥无期
遥遥无期 2020-12-02 10:02

I started using Django release 1.5 and got a problem with my old code:

{{post.title}}<

6条回答
  •  没有蜡笔的小新
    2020-12-02 10:23

    Firstly, you were correct to use single quotes for the view name, i.e. 'auto.views.view_post'.

    Now, temporarily remove the url tag, and check that {{ post }} and {{ post.slug }} give you the values you expect. The error message arguments '('',)' suggests that post.slug is the problem.

提交回复
热议问题