是否可以在 Django 中为不同的平面链接特定模板?
例如:
/about/ -> templates/flatpages/about.html
/contact/ -> templates/flatpages/contact.html
这就是我所拥有的,但所有这些页面都指向 default.html 模板
url(r'^(?P<url>about/)$', 'django.contrib.flatpages.views.flatpage'),
url(r'^(?P<url>contact/)$', 'django.contrib.flatpages.views.flatpage'),
url(r'^(?P<url>feedback/)$', 'django.contrib.flatpages.views.flatpage'),