Hello everyone,
I hope my questions don't sound ridiculous. In my team, I have been tasked with moving our mailman installations from version 1:2.1 to the current version, mailman3. I followed the documentations online and installed all the components, created a Django project and configured settings.py and url.py. However, when I run the development server, I receive the following on the body of Postorius main page:
Page not found This page either doesn't exist, or it moved somewhere else.
Clicking on the "Lists" menu link, I receive the following:
HTTP Error 404: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>example.com</title> <link rel="shortcut icon" href="/static/postorius/img/favicon.ico"> <link rel="stylesheet" href="/static/postorius/libs/bootstrap/css/bootstrap.min.css"> <link rel="stylesheet" href="/static/django-mailman3/css/main.css"> <link rel="stylesheet" href="/static/postorius/css/style.css"> <link rel="stylesheet" href="/static/postorius/libs/fonts/font-awesome/css/font-awesome.min.css" type="text/css" media="all" /> <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="/static/postorius/libs/html5shiv/html5shiv.min.js"></script> <script src="/static/postorius/libs/respond/respond.min.js"></script> <![endif]--> </head> <body> <nav class="navbar navbar-expand-md navbar-light bg-light navbar-default"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggler collapsed" data-toggle="collapse" data-target="#header-nav" aria-expanded="false"> <span class="sr-only">Toggle navigation</span> <span class="fa fa-bars"></span> </button> <a class="navbar-brand" href="/mailman3/lists/"><span><img src="/static/postorius/img/mailman_logo_small_trans.png" alt="Mailman logo"/> Postorius</span></a> </div> <div class="collapse navbar-collapse" id="header-nav"> <ul class="nav navbar-nav mr-auto"> <li class="nav-item"><a href="/mailman3/lists/" class="nav-link"> <span class="fa fa-envelope"></span> Lists </a></li> <li class="nav-item"><a href="/archives/" class="nav-link"> <span class="fa fa-comment"></span> Archives </a></li> </ul> <ul class="nav navbar-nav navbar-right"> <li class="nav-item"><a class="nav-link" href="/accounts/login/?next=/3.1/lists"> <span class="fa fa-sign-in"></span> Login </a></li> <li class="nav-item"><a class="nav-link" href="/accounts/signup/?next=/3.1/lists"> <span class="fa fa-user-plus"></span> Sign Up </a></li> </ul> </div> </div> </nav> <div class="container" role="main"> <h1>Page not found</h1> <div class="alert alert-danger">This page either doesn't exist, or it moved somewhere else.</div> </div> <footer class="footer"> <div class="container"> <p class="text-center"> <a href="https://postorius.readthedocs.org">Postorius Documentation</a> • <a href="http://list.org">GNU Mailman</a> • Postorius Version 1.3.3 • Happy Mailman Day! </p> </div> </footer> <script src="/static/postorius/libs/jquery/jquery-1.11.3.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js" integrity="sha384-b/U6ypiBEHpOf/4+1nzFpr53nxSS+GLCkfwBdFNTxtclqqenISfwAzpKaMNFNmj4" crossorigin="anonymous"></script> <script src="/static/postorius/libs/bootstrap/js/bootstrap.min.js"></script> <script src="/static/django-mailman3/js/main.js"></script> <script src="/static/postorius/js/script.js"></script> </body> </html>
So far, the Postorious component is where there seem to be issues, all other link or component produce no errors thus far. Please advice on how I can troubleshoot this. I herein include the relevant sessions of my settings.py file and url.py which I have tweaked with various configurations to no avail.
settings.py:
# Application definition
INSTALLED_APPS = [ # Apps added for mailman components 'hyperkitty', 'postorius', 'django_mailman3', 'mailmanclient', # Other useful apps 'rest_framework', 'django_gravatar', 'compressor', 'haystack', 'django_extensions', 'django_q', 'allauth', 'allauth.account', 'allauth.socialaccount', # end other useful apps 'django.contrib.sites', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', ]
url.py:
urlpatterns = [ #Django admin path('admin/', admin.site.urls), path('mailman3/', include('postorius.urls')), path('archives/', include('hyperkitty.urls')), path('', include('django_mailman3.urls')), path('accounts/', include('allauth.urls')), #path('postorius', include('postorius.urls')), #path('lists/', list_index), path('search/', include('haystack.urls')), #url(r'^$', list_index), ]
Note that when I uncomment the lines relating to list_index or use configurations similar to that on mailman-suit, I get:
NameError: name 'list_index' is not defined.
Looking forward to any help anyone can render.
Thank you!
Regards, Jane.
On Tue, Sep 1, 2020, at 9:55 AM, Jane Anara via Mailman-users wrote:
Hello everyone,
I hope my questions don't sound ridiculous. In my team, I have been tasked with moving our mailman installations from version 1:2.1 to the current version, mailman3. I followed the documentations online and installed all the components, created a Django project and configured settings.py and url.py. However, when I run the development server, I receive the following on the body of Postorius main page:
Page not found This page either doesn't exist, or it moved somewhere else.
Clicking on the "Lists" menu link, I receive the following:
HTTP Error 404: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>example.com</title> <link rel="shortcut icon" href="/static/postorius/img/favicon.ico"> <link rel="stylesheet" href="/static/postorius/libs/bootstrap/css/bootstrap.min.css"> <link rel="stylesheet" href="/static/django-mailman3/css/main.css"> <link rel="stylesheet" href="/static/postorius/css/style.css"> <link rel="stylesheet" href="/static/postorius/libs/fonts/font-awesome/css/font-awesome.min.css" type="text/css" media="all" /> <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="/static/postorius/libs/html5shiv/html5shiv.min.js"></script> <script src="/static/postorius/libs/respond/respond.min.js"></script> <![endif]--> </head> <body> <nav class="navbar navbar-expand-md navbar-light bg-light navbar-default"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggler collapsed" data-toggle="collapse" data-target="#header-nav" aria-expanded="false"> <span class="sr-only">Toggle navigation</span> <span class="fa fa-bars"></span> </button> <a class="navbar-brand" href="/mailman3/lists/"><span><img src="/static/postorius/img/mailman_logo_small_trans.png" alt="Mailman logo"/> Postorius</span></a> </div> <div class="collapse navbar-collapse" id="header-nav"> <ul class="nav navbar-nav mr-auto"> <li class="nav-item"><a href="/mailman3/lists/" class="nav-link"> <span class="fa fa-envelope"></span> Lists </a></li> <li class="nav-item"><a href="/archives/" class="nav-link"> <span class="fa fa-comment"></span> Archives </a></li> </ul> <ul class="nav navbar-nav navbar-right"> <li class="nav-item"><a class="nav-link" href="/accounts/login/?next=/3.1/lists"> <span class="fa fa-sign-in"></span> Lo gin </a></li> <li class="nav-item"><a class="nav-link" href="/accounts/signup/?next=/3.1/lists"> <span class="fa fa-user-plus"></span> Sign Up </a></li> </ul> </div> </div> </nav> <div class="container" role="main"> <h1>Page not found</h1> <div class="alert alert-danger">This page either doesn't exist, or it moved somewhere else.</div> </div> <footer class="footer"> <div class="container"> <p class="text-center"> <a href="https://postorius.readthedocs.org">Postorius Documentation</a> • <a href="http://list.org">GNU Mailman</a> • Postorius Version 1.3.3 • Happy Mailman Day! </p> </div> </footer> <script src="/static/postorius/libs/jquery/jquery-1.11.3.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js" integrity="sha384-b/U6ypiBEHpOf/4+1nzFpr53nxSS+GLCkfwBdFNTxtclqqenISfwAzpKaMNFNmj4" crossorigin="anonymous"></script> <script src="/static/postorius/libs/bootstrap/js/bootstrap.min.js"></script> <script src="/static/d jango-mailman3/js/main.js"></script> <script src="/static/postorius/js/script.js"></script> </body> </html>
So far, the Postorious component is where there seem to be issues, all other link or component produce no errors thus far. Please advice on how I can troubleshoot this. I herein include the relevant sessions of my settings.py file and url.py which I have tweaked with various configurations to no avail.
settings.py:
# Application definition
INSTALLED_APPS = [ # Apps added for mailman components 'hyperkitty', 'postorius', 'django_mailman3', 'mailmanclient', # Other useful apps 'rest_framework', 'django_gravatar', 'compressor', 'haystack', 'django_extensions', 'django_q', 'allauth', 'allauth.account', 'allauth.socialaccount', # end other useful apps 'django.contrib.sites', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', ]
url.py:
urlpatterns = [ #Django admin path('admin/', admin.site.urls), path('mailman3/', include('postorius.urls')), path('archives/', include('hyperkitty.urls')), path('', include('django_mailman3.urls')), path('accounts/', include('allauth.urls')), #path('postorius', include('postorius.urls')), #path('lists/', list_index), path('search/', include('haystack.urls')), #url(r'^$', list_index), ]
Note that when I uncomment the lines relating to list_index or use configurations similar to that on mailman-suit, I get:
NameError: name 'list_index' is not defined.
You need to use the view function with reverse_lazy
to actually get the
named reverse_lazy
view.
Did you try using the exact urls.py from mailman-suite project1? It has been tested to work locally and other place.
Looking forward to any help anyone can render.
Thank you!
Regards, Jane.
Mailman-users mailing list -- mailman-users@mailman3.org To unsubscribe send an email to mailman-users-leave@mailman3.org https://lists.mailman3.org/mailman3/lists/mailman-users.mailman3.org/
-- thanks, Abhilash Raj (maxking)
Hello Abhilash,
Thank you for your reply.
I did use the mailman-suit url.py before and got similar errors. At your suggestion, I again included the following in the import session:
from django.urls import reverse_lazy from django.views.generic import RedirectView
and the following line in the urlpatterns:
url(r'^$', RedirectView.as_view(url=reverse_lazy ('list_index'), permanent=True)),
The 'list_index' undefined error does not come up, however the HTTP Error 404 I posted in my last message still shows up. I abstracted the following from the error log as a potential cause:
Traceback (most recent call last): File "/opt/mailman/venv/lib/python3.6/site-packages/django/core/handlers/base.py", line 113, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/opt/mailman/venv/lib/python3.6/site-packages/postorius/views/list.py", line 779, in list_index paginator_class=MailmanPaginator) File "/opt/mailman/venv/lib/python3.6/site-packages/django_mailman3/lib/paginator.py", line 71, in paginate objects = paginator.page(page_num) File "/opt/mailman/venv/lib/python3.6/site-packages/django_mailman3/lib/paginator.py", line 46, in page number = self.validate_number(number) File "/opt/mailman/venv/lib/python3.6/site-packages/django/core/paginator.py", line 48, in validate_number if number > self.num_pages: File "/opt/mailman/venv/lib/python3.6/site-packages/django/utils/functional.py", line 48, in __get__ res = instance.__dict__[self.name] = self.func(instance) File "/opt/mailman/venv/lib/python3.6/site-packages/django/core/paginator.py", line 97, in num_pages if self.count == 0 and not self.allow_empty_first_page: File "/opt/mailman/venv/lib/python3.6/site-packages/django/utils/functional.py", line 48, in __get__ res = instance.__dict__[self.name] = self.func(instance) File "/opt/mailman/venv/lib/python3.6/site-packages/django_mailman3/lib/paginator.py", line 56, in count return self.function(count=0, page=1).total_size File "/opt/mailman/venv/lib/python3.6/site-packages/postorius/views/list.py", line 775, in _get_list_page advertised=advertised, mail_host=mail_host, count=count, page=page) File "/opt/mailman/venv/lib/python3.6/site-packages/mailmanclient/client.py", line 181, in get_list_page return Page(self._connection, url, MailingList, count, page) File "/opt/mailman/venv/lib/python3.6/site-packages/mailmanclient/restbase/page.py", line 37, in __init__ self._create_page() File "/opt/mailman/venv/lib/python3.6/site-packages/mailmanclient/restbase/page.py", line 62, in _create_page response, content = self._connection.call(self._build_url()) File "/opt/mailman/venv/lib/python3.6/site-packages/mailmanclient/restbase/connection.py", line 112, in call error_msg, response, None) urllib.error.HTTPError: HTTP Error 404:
I would appreciate any insight.
Thank you.
Regards, Jane
On Wed, Sep 2, 2020, at 10:28 AM, Jane Anara via Mailman-users wrote:
Hello Abhilash,
Thank you for your reply.
I did use the mailman-suit url.py before and got similar errors. At your suggestion, I again included the following in the import session:
from django.urls import reverse_lazy from django.views.generic import RedirectView
and the following line in the urlpatterns:
url(r'^$', RedirectView.as_view(url=reverse_lazy ('list_index'), permanent=True)),
The 'list_index' undefined error does not come up, however the HTTP Error 404 I posted in my last message still shows up. I abstracted the following from the error log as a potential cause:
Traceback (most recent call last): File "/opt/mailman/venv/lib/python3.6/site-packages/django/core/handlers/base.py", line 113, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/opt/mailman/venv/lib/python3.6/site-packages/postorius/views/list.py", line 779, in list_index paginator_class=MailmanPaginator) File "/opt/mailman/venv/lib/python3.6/site-packages/django_mailman3/lib/paginator.py", line 71, in paginate objects = paginator.page(page_num) File "/opt/mailman/venv/lib/python3.6/site-packages/django_mailman3/lib/paginator.py", line 46, in page number = self.validate_number(number) File "/opt/mailman/venv/lib/python3.6/site-packages/django/core/paginator.py", line 48, in validate_number if number > self.num_pages: File "/opt/mailman/venv/lib/python3.6/site-packages/django/utils/functional.py", line 48, in __get__ res = instance.__dict__[self.name] = self.func(instance) File "/opt/mailman/venv/lib/python3.6/site-packages/django/core/paginator.py", line 97, in num_pages if self.count == 0 and not self.allow_empty_first_page: File "/opt/mailman/venv/lib/python3.6/site-packages/django/utils/functional.py", line 48, in __get__ res = instance.__dict__[self.name] = self.func(instance) File "/opt/mailman/venv/lib/python3.6/site-packages/django_mailman3/lib/paginator.py", line 56, in count return self.function(count=0, page=1).total_size File "/opt/mailman/venv/lib/python3.6/site-packages/postorius/views/list.py", line 775, in _get_list_page advertised=advertised, mail_host=mail_host, count=count, page=page) File "/opt/mailman/venv/lib/python3.6/site-packages/mailmanclient/client.py", line 181, in get_list_page return Page(self._connection, url, MailingList, count, page) File "/opt/mailman/venv/lib/python3.6/site-packages/mailmanclient/restbase/page.py", line 37, in __init__ self._create_page() File "/opt/mailman/venv/lib/python3.6/site-packages/mailmanclient/restbase/page.py", line 62, in _create_page response, content = self._connection.call(self._build_url()) File "/opt/mailman/venv/lib/python3.6/site-packages/mailmanclient/restbase/connection.py", line 112, in call error_msg, response, None) urllib.error.HTTPError: HTTP Error 404:
I would appreciate any insight.
This is trying to reach Mailman core and getting a 404 response from Mailman Core.
Do you have Core running? Which version of Core are you running?
Thank you.
Regards, Jane
Mailman-users mailing list -- mailman-users@mailman3.org To unsubscribe send an email to mailman-users-leave@mailman3.org https://lists.mailman3.org/mailman3/lists/mailman-users.mailman3.org/
-- thanks, Abhilash Raj (maxking)
Thank you Abhilash for your reply. I installed Mailman Core version 3.3.1.
After your message, I ran mailman start
and then ran the development server. It complained of the port already in used and exited. That is what I got in the past as well. This time, I changed the CORE REST API port on django settings.py from port 8000 to 8001 and ran the development server (which I often ran on 8001) on port 8006. The error has gone away.
Thank you for your help.
Regards, Jane
On Fri, Sep 4, 2020, at 8:34 AM, Jane Anara via Mailman-users wrote:
Thank you Abhilash for your reply. I installed Mailman Core version 3.3.1.
After your message, I ran
mailman start
and then ran the development server. It complained of the port already in used and exited. That is what I got in the past as well. This time, I changed the CORE REST API port on django settings.py from port 8000 to 8001 and ran the development server (which I often ran on 8001) on port 8006. The error has gone away.
By default, Core's REST API runs on Port 8001 and Django uses 8000. If you were using 8000 for the Core's Port in settings.py, that would mean Postorius was trying to talk to itself and hence the 404 errors with the URLs.
Thank you for your help.
Regards, Jane
Mailman-users mailing list -- mailman-users@mailman3.org To unsubscribe send an email to mailman-users-leave@mailman3.org https://lists.mailman3.org/mailman3/lists/mailman-users.mailman3.org/
-- thanks, Abhilash Raj (maxking)
participants (2)
-
Abhilash Raj
-
Jane Anara