15.4.3 Displaying FlatPage Objects via the URL Configuration

According to the Django documentation we can display FlatPage instances by including the flatpages app URL configuration in our own root URL configuration in suorganizer/urls.py, as shown in Example 15.17.

Example 15.17: Project Code

suorganizer/urls.py in 2a02d29ec6

18  from django.contrib.flatpages import \ 19      urls as flatpages_urls  .      ... 29  urlpatterns = [  .      ... 35      url(r'^page', include(flatpages_urls)),  .      ... 38  ]

If you try to run Django’s development server via ./manage.py runserver, you will be unable to reach the about webpage at /about/. Instead, the page will be displayed at /page/about/.

Warning

If you forget ...

Get Django Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.