0

I want to create a home page containing a list of feincms pages and linked to their url.

I am trying

{% url page_obj.get_absolute_url %} 

which is throwing an error

Reverse for '/test/' with arguments '()'

The feincms page resides at localhost/test/

I have included the following in the urls.py

urlpatterns += patterns('',
    url(r'', include('feincms.contrib.preview.urls')),
    url(r'', include('feincms.urls')),
)
4

1 に答える 1

1

get_absolute_url()すでに最終的な URL を返しています。{% url %}templatetagに渡す必要はありません。テンプレートで変数置換を行うだけです。

<a href="{{ page_obj.get_absolute_url }}">
于 2014-04-29T07:57:11.777 に答える