from django.conf.urls import url

from .views import SpaCmsPageDetailApiView

urlpatterns = [
    url(r'^(?P<language_code>[\w-]+)/pages/$', SpaCmsPageDetailApiView.as_view(), name='cms_page_detail_home'),
    url(r'^(?P<language_code>[\w-]+)/pages/(?P<path>.*)/$', SpaCmsPageDetailApiView.as_view(), name='cms_page_detail'),
]

from django.conf.urls import url

from .views import SpaCmsPageDetailApiView

urlpatterns = [
    url(r'^pages/$', SpaCmsPageDetailApiView.as_view(), name='cms_page_detail_home'),
    url(r'^pages/(?P<path>.*)/$', SpaCmsPageDetailApiView.as_view(), name='cms_page_detail'),
]

Remove language code from path
Remove language code from path

We no longer need the language detection in the URL. The locale
middleware already handles the language properly and we can consume
it from the request.

  from django.conf.urls import url
  
  from .views import SpaCmsPageDetailApiView
  
  urlpatterns = [
-     url(r'^(?P<language_code>[\w-]+)/pages/$', SpaCmsPageDetailApiView.as_view(), name='cms_page_detail_home'),
+     url(r'^pages/$', SpaCmsPageDetailApiView.as_view(), name='cms_page_detail_home'),
-     url(r'^(?P<language_code>[\w-]+)/pages/(?P<path>.*)/$', SpaCmsPageDetailApiView.as_view(), name='cms_page_detail'),
+     url(r'^pages/(?P<path>.*)/$', SpaCmsPageDetailApiView.as_view(), name='cms_page_detail'),
  ]
  
Remove language code from path
## Code Before:
from django.conf.urls import url

from .views import SpaCmsPageDetailApiView

urlpatterns = [
    url(r'^(?P<language_code>[\w-]+)/pages/$', SpaCmsPageDetailApiView.as_view(), name='cms_page_detail_home'),
    url(r'^(?P<language_code>[\w-]+)/pages/(?P<path>.*)/$', SpaCmsPageDetailApiView.as_view(), name='cms_page_detail'),
]

## Instruction:
Remove language code from path
## Code After:
from django.conf.urls import url

from .views import SpaCmsPageDetailApiView

urlpatterns = [
    url(r'^pages/$', SpaCmsPageDetailApiView.as_view(), name='cms_page_detail_home'),
    url(r'^pages/(?P<path>.*)/$', SpaCmsPageDetailApiView.as_view(), name='cms_page_detail'),
]
