From 2b0dbfa1e50cdf97b3810872fe740152d9663a2e Mon Sep 17 00:00:00 2001 From: "M.Ravi" Date: Fri, 22 Sep 2017 08:47:42 +0200 Subject: [PATCH] Added /cms prefix to django-cms urls --- dynamicweb/urls.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/dynamicweb/urls.py b/dynamicweb/urls.py index 84f3fb3d..2adce271 100644 --- a/dynamicweb/urls.py +++ b/dynamicweb/urls.py @@ -5,7 +5,8 @@ from django.conf.urls.static import static from django.views import i18n, static as static_view from django.conf import settings -from hosting.views import RailsHostingView, DjangoHostingView, NodeJSHostingView +from hosting.views import RailsHostingView, DjangoHostingView, \ + NodeJSHostingView from membership import urls as membership_urls from ungleich_page.views import LandingView from django.views.generic import RedirectView @@ -49,9 +50,14 @@ urlpatterns += i18n_patterns( include('ungleich_page.urls', namespace='ungleich_page'), name='ungleich_page'), - url(r'^blog/', include('ungleich.urls', - namespace='ungleich')), - url(r'^', include('cms.urls')) + url(r'^cms/blog/', + include('ungleich.urls', namespace='ungleich')), + url( + r'^blog/(?P\d{4})/(?P\d{1,2})/(?P\d{1,2})/(?P\w[-\w]*)/$', + RedirectView.as_view(pattern_name='ungleich:post-detail')), + url(r'^blog/|cms/$', RedirectView.as_view( + url=reverse_lazy('ungleich:post-list')), name='blog_list_view'), + url(r'^cms/', include('cms.urls')), ) urlpatterns += [