Mailman upgrade results in page not found error
Hi.
Just doing the Mailman suite upgrade on my small installation I use for test purposes.
Steps include: Run backup script Stop services Mv venv venv-old python3 -m venv --system-site-packages --symlinks venv source venv/bin/activate pip install -U pip pip install mailman mailman-hyperkitty hyperkitty postorius whoosh deactivate ./bin/Django-admin collectstatic ./bin/Django-admin migrate
At this step I got an error regarding the import of URLs, a quick Google suggested this was because the new venv has upgraded to Django 4.0. I downloaded the urls.py from the mailman-web Git repo (I should migrate to this at some point I know) and replaced my version with this one. This allowed the migrate to run correctly.
Once services were up everything worked as expected except for the web page. If you go to https://lists.hodgsonfamily.org you get a Postorius page not found error, however if you click on the Mailman logo you get to the correct place. I think this is a problem with the new urls.py I downloaded, what is the best way to restore the old behaviour of having https://lists.hodgsonfamily.org going to the correct place?
Urls.py: # -*- coding: utf-8 -*- # Copyright (C) 1998-2016 by the Free Software Foundation, Inc. # # This file is part of Postorius. # # Postorius is free software: you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free # Software Foundation, either version 3 of the License, or (at your option) # any later version. # # Postorius is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for # more details. # # You should have received a copy of the GNU General Public License along with # Postorius. If not, see http://www.gnu.org/licenses/.
from django.conf.urls import include from django.contrib import admin from django.urls import path, reverse_lazy from django.views.generic import RedirectView
urlpatterns = [ path( '', RedirectView.as_view(url=reverse_lazy('list_index'), permanent=True), ), path('mailman3/', include('postorius.urls')), path('archives/', include('hyperkitty.urls')), path('', include('django_mailman3.urls')), path('accounts/', include('allauth.urls')), path('admin/', admin.site.urls), ]
Thanks. Andrew.
El 3/11/22 a las 14:00, Andrew Hodgson escribió:
Hi.
Just doing the Mailman suite upgrade on my small installation I use for test purposes.
Steps include: Run backup script Stop services Mv venv venv-old python3 -m venv --system-site-packages --symlinks venv source venv/bin/activate pip install -U pip pip install mailman mailman-hyperkitty hyperkitty postorius whoosh deactivate ./bin/Django-admin collectstatic ./bin/Django-admin migrate
At this step I got an error regarding the import of URLs, a quick Google suggested this was because the new venv has upgraded to Django 4.0. I downloaded the urls.py from the mailman-web Git repo (I should migrate to this at some point I know) and replaced my version with this one. This allowed the migrate to run correctly.
I found the same error, I modified urls.py in the way below:
### from django.conf import settings ### mod. 30/10/22 ###from django.conf.urls import include, url from django.conf.urls import include from django.urls import re_path as url #####
Leaving the rest of original urls.py lines unmodified.
Once services were up everything worked as expected except for the web page. If you go tohttps://lists.hodgsonfamily.org you get a Postorius page not found error, however if you click on the Mailman logo you get to the correct place. I think this is a problem with the new urls.py I downloaded, what is the best way to restore the old behaviour of havinghttps://lists.hodgsonfamily.org going to the correct place?
Urls.py: # -*- coding: utf-8 -*- # Copyright (C) 1998-2016 by the Free Software Foundation, Inc. # # This file is part of Postorius. # # Postorius is free software: you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free # Software Foundation, either version 3 of the License, or (at your option) # any later version. # # Postorius is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for # more details. # # You should have received a copy of the GNU General Public License along with # Postorius. If not, seehttp://www.gnu.org/licenses/.
from django.conf.urls import include from django.contrib import admin from django.urls import path, reverse_lazy from django.views.generic import RedirectView
urlpatterns = [ path( '', RedirectView.as_view(url=reverse_lazy('list_index'), permanent=True), ), path('mailman3/', include('postorius.urls')), path('archives/', include('hyperkitty.urls')), path('', include('django_mailman3.urls')), path('accounts/', include('allauth.urls')), path('admin/', admin.site.urls), ]
Thanks. Andrew.
Mailman-users mailing list --mailman-users@mailman3.org To unsubscribe send an email tomailman-users-leave@mailman3.org https://lists.mailman3.org/mailman3/lists/mailman-users.mailman3.org/
--
Mailman's content filtering has removed the following MIME parts from this message.
Content-Type: image/png Name: firma-GHP-emails.png
Replaced multipart/alternative part with first alternative.
On 11/3/22 18:30, Andrew Hodgson wrote:
I think this is a problem with the new urls.py I downloaded, what is the best way to restore the old behaviour of having https://lists.hodgsonfamily.org going to the correct place? urlpatterns = [ path( '', RedirectView.as_view(url=reverse_lazy('list_index'), permanent=True), ), path('mailman3/', include('postorius.urls')),
You _probably_ had DOMAIN/postorius as your URL? If that's the case, replace the 'mailman3/' above with your old 'posotorius/' in your new urls.py.
That should fix the problem you are having with 404 because you browser probably remembers the old URL and tries to auto-redirect root path to /postorius.
-- thanks, Abhilash Raj (maxking)
Abhilash Raj wrote:
On 11/3/22 18:30, Andrew Hodgson wrote:
I think this is a problem with the new urls.py I downloaded, what is the best way to restore the old behaviour of having https://lists.hodgsonfamily.org going to the correct place? urlpatterns = [ path( '', RedirectView.as_view(url=reverse_lazy('list_index'), permanent=True), ), path('mailman3/', include('postorius.urls')),
You _probably_ had DOMAIN/postorius as your URL? If that's the case, replace the 'mailman3/' above with your old 'posotorius/' in your new urls.py. That should fix the problem you are having with 404 because you browser probably remembers the old URL and tries to auto-redirect root path to /postorius.
Yep that was it. I actually left it be in the end as users were accessing the new page fine. I had to update mailman-hyperkitty with the new URL as archiving wasn't working but that has now been done and everything seems to be back to normal on the new setup.
Thanks. Andrew.
participants (3)
-
Abhilash Raj
-
Andrew Hodgson
-
Guillermo Hernandez (Oldno7)