
from django.conf.urls import patterns, url
from django.contrib.auth.decorators import login_required

from .views import GuidesView


urlpatterns = patterns('',
    url(r'^$', login_required(GuidesView.as_view()), name='index'))


from django.conf.urls import url
from django.contrib.auth.decorators import login_required

from .views import GuidesView


urlpatterns = [
    url(r'^$', login_required(GuidesView.as_view()), name='index'),
]

Fix patterns for Django > 1.10
Fix patterns for Django > 1.10

Pike requires Django 1.11 so fix the template pattern import which was
not compatible with that version. This fixes:

File
"/srv/www/openstack-dashboard/openstack_dashboard/dashboards/help/guides/\
    urls.py", line 15, in <module>
from django.conf.urls import patterns, url
ImportError: cannot import name patterns

  
- from django.conf.urls import patterns, url
+ from django.conf.urls import url
  from django.contrib.auth.decorators import login_required
  
  from .views import GuidesView
  
  
- urlpatterns = patterns('',
+ urlpatterns = [
-     url(r'^$', login_required(GuidesView.as_view()), name='index'))
+     url(r'^$', login_required(GuidesView.as_view()), name='index'),
+ ]
  
Fix patterns for Django > 1.10
## Code Before:

from django.conf.urls import patterns, url
from django.contrib.auth.decorators import login_required

from .views import GuidesView


urlpatterns = patterns('',
    url(r'^$', login_required(GuidesView.as_view()), name='index'))

## Instruction:
Fix patterns for Django > 1.10
## Code After:

from django.conf.urls import url
from django.contrib.auth.decorators import login_required

from .views import GuidesView


urlpatterns = [
    url(r'^$', login_required(GuidesView.as_view()), name='index'),
]
