old_contents: from django.conf.urls.defaults import patterns, include, url
  import settings
  import os
  
  from django.contrib import admin
  admin.autodiscover()
  
  urlpatterns = patterns('',
  
      url(r'^$',
          'django.views.generic.simple.direct_to_template',
          {'template': 'index.html'}
          ),
  
      url(r'^test/', 'test_app.views.test_index'),
  
      url(r'^admin/', include(admin.site.urls)),
  )
  
  if settings.DEBUG:
      urlpatterns += patterns(
          '',
          (r'^static/(?P<path>.*)$', 'django.views.static.serve',
           {'document_root': os.path.join(
              os.path.dirname(settings.__file__),
              'static')}))
  
new_contents: try:
      from django.conf.urls.defaults import patterns, include, url
  except ImportError:
      from django.conf.urls import patterns, url, include
  
  import settings
  import os
  
  from django.contrib import admin
  admin.autodiscover()
  
  urlpatterns = patterns('',
  
      url(r'^$',
          'django.views.generic.simple.direct_to_template',
          {'template': 'index.html'}
          ),
  
      url(r'^test/', 'test_app.views.test_index'),
  
      url(r'^admin/', include(admin.site.urls)),
  )
  
  if settings.DEBUG:
      urlpatterns += patterns(
          '',
          (r'^static/(?P<path>.*)$', 'django.views.static.serve',
           {'document_root': os.path.join(
              os.path.dirname(settings.__file__),
              'static')}))
  
subject: Fix for 1.6 & 1.7