質問

Besides portfolio and blog, i have some flatpages in my site. Site tree, breadcrumbs and menu i passed through django-sitetree. And i cant understand how get URI of my flatpages from admin interface with django-sitetree app. With title it is OK - just {{ flatpage.title }}.

Would be glad to see any help .

役に立ちましたか?

解決

It seems like sitetree only supports named url patterns or "exact" urls. Because flatpages doesn't have a named url pattern by default, you could create one, like:

urlpatterns = patterns(
    'django.contrib.flatpages.views',
    url(r'^(?P<url>.*)$', 'flatpage', name='flatpages-page'),
)

Include that at top level or put it directly in your root urlconf (at the end). And then put flatpages-page flatpage.url into your tree item, check 'URL as Pattern' and it should work.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top