old_contents: """URLs for the webmap app."""
  from django.conf.urls import patterns, include, url
  from webmap import views
  from rest import router
  
  
  urlpatterns = patterns(
      '',
      (r'^kml/([-\w]+)/$', views.kml_view),
      (r'^search/([- \w]+)/$', views.search_view),
      url(r'^', include(router.urls)),
      url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')),
  )
  
new_contents: """URLs for the webmap app."""
  from django.conf.urls import patterns, include, url
  from webmap import views
  from rest import router
  import settings
  
  
  urlpatterns = patterns(
      '',
      (r'^kml/([-\w]+)/$', views.kml_view),
      (r'^search/([- \w]+)/$', views.search_view),
  )
  
  if getattr(settings, 'REST_ENABLED', False):
     urlpatterns.append(url(r'^', include(router.urls)))
     urlpatterns.append(url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')))
  
subject: make REST api conditional