15.4.5 Switching Back to a URL Configuration

If we disable the middleware, we can add a URL pattern without a prefix to our root URL configuration to include FlatPage objects, as shown in Example 15.20.

Example 15.20: Project Code

suorganizer/urls.py in 95d9c3ecd9

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

Prior to Chapter 11, Section 11.4, our contact URL configuration was included in the same way, as shown in Example 15.21.

Example 15.21: Project Code

suorganizer/urls.py in 3969d84738

30     url(r'^', include(organizer_urls)),

If we had not split our URL configuration ...

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.