From eb23cb7cd668726fe1961242c703be1749370330 Mon Sep 17 00:00:00 2001 From: Kiran Kolte <62833568+kskolte2020@users.noreply.github.com> Date: Tue, 3 Dec 2024 10:00:54 +0530 Subject: [PATCH] Issue 2662 Update urls.py Redirect pythoninsider.blogspot.com to blog.python.org and other permalinks as well. --- blogs/urls.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/blogs/urls.py b/blogs/urls.py index d315ed486..ef601caa8 100644 --- a/blogs/urls.py +++ b/blogs/urls.py @@ -1,6 +1,9 @@ from . import views -from django.urls import path +from django.urls import path, re_path +from django.views.generic.base import RedirectView urlpatterns = [ path('', views.BlogHome.as_view(), name='blog'), + # Redirect all requests from pythoninsider.blogspot.com to blog.python.org + re_path(r'^(?P.*)$', RedirectView.as_view(url='https://blog.python.org/%(path)s', permanent=True)), ]