static files not found in Mailman3 Web
ello,
I have installed Mailman3 Core 3.3.8 + Mailman Web from AlmaLinux 9 distro. I have problems with static files in Mailman Web.
After starting development server at http://127.0.0.1:8000/
DJANGO_SETTINGS_MODULE= settings MAILMAN_WEB_CONFIG= /etc/mailman3/settings.py PYTHONPATH= /etc/mailman3
I'm pointiong browser on http://127.0.0.1:8000/ address and getting intitial Mailman Web page like this:
http://127.0.0.1:8000/mailman3/lists/
Mailman logo Postorius
Lists
Archives
Login
Sign Up
Mailing Lists ...
Instead of Postorius Logo I've got text "Mailman logo Postorius" on the page. "View Page Source" in browser shows: <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" />
Mailman Web has the following configuration:
/etc/mailman3/settings.py
# Mailman Web configuration file. # /etc/mailman3/settings.py
from mailman_web.settings.base import * from mailman_web.settings.mailman import *
# 'collectstatic' command will copy all the static files here.
# Alias this location from your webserver to /static
STATIC_ROOT = '/opt/mailman/web/static'
All static files are placed in /opt/mailman/web/static
drwxr-xr-x. 5 mailman mailman 38 Sep 6 15:48 admin drwxr-xr-x. 4 mailman mailman 48 Sep 6 17:08 CACHE drwxr-xr-x. 2 mailman mailman 39 Sep 6 15:48 css drwxr-xr-x. 5 mailman mailman 38 Sep 6 15:48 django_extensions drwxr-xr-x. 5 mailman mailman 38 Sep 6 15:48 django-mailman3 drwxr-xr-x. 6 mailman mailman 51 Sep 6 15:48 hyperkitty drwxr-xr-x. 3 mailman mailman 128 Sep 6 15:48 img drwxr-xr-x. 2 mailman mailman 62 Sep 6 15:48 js drwxr-xr-x. 8 mailman mailman 98 Sep 6 15:48 libs drwxr-xr-x. 6 mailman mailman 50 Sep 6 15:48 postorius drwxr-xr-x. 7 mailman mailman 63 Sep 6 15:48 rest_framework
/usr/lib/python3.9/site-packages/mailman_web/settings/base.py
#: The base directory for logs and database. BASE_DIR = Path('/opt/mailman/web')
#: Enable Development Mode. DEBUG = False
#: URL Configuration for Django ROOT_URLCONF = 'mailman_web.urls'
#: Default path where static files will be placed. STATIC_ROOT = '/opt/mailman/web/static' #: URL prefix for static files. #: Example: "http://example.com/static/", "http://static.example.com/" STATIC_URL = '/static/'
...
/usr/lib/python3.9/site-packages/mailman_web/settings/mailman.py
BASE_DIR = Path('/opt/mailman/web')
#: Mailman Core default API Path MAILMAN_REST_API_URL = 'http://localhost:8001'
#: Base URL where Django/Mailman-web would be listening for requests. Used by #: Mailman Core for fetching templates. POSTORIUS_TEMPLATE_BASE_URL = 'http://localhost:8000' ...
Why dont static files get found ? If I set Debug = True then static files are getting found. Why ? But in production mode Debug should be set False. How to solve static files problem in production ?
On Mon, Sep 9, 2024 at 5:24 PM Anatoly Oreshkin <anatoly.oreshkin@gmail.com> wrote:
ello,
I have installed Mailman3 Core 3.3.8 + Mailman Web from AlmaLinux 9 distro. I have problems with static files in Mailman Web.
After starting development server at http://127.0.0.1:8000/
DJANGO_SETTINGS_MODULE= settings MAILMAN_WEB_CONFIG= /etc/mailman3/settings.py PYTHONPATH= /etc/mailman3
I'm pointiong browser on http://127.0.0.1:8000/ address and getting intitial Mailman Web page like this:
http://127.0.0.1:8000/mailman3/lists/
Mailman logo Postorius
Lists Archives Login Sign Up
Mailing Lists ...
Instead of Postorius Logo I've got text "Mailman logo Postorius" on the page. "View Page Source" in browser shows: <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" />
Mailman Web has the following configuration:
/etc/mailman3/settings.py
# Mailman Web configuration file. # /etc/mailman3/settings.py
from mailman_web.settings.base import * from mailman_web.settings.mailman import *
# 'collectstatic' command will copy all the static files here. # Alias this location from your webserver to
/static
STATIC_ROOT = '/opt/mailman/web/static'All static files are placed in /opt/mailman/web/static
drwxr-xr-x. 5 mailman mailman 38 Sep 6 15:48 admin drwxr-xr-x. 4 mailman mailman 48 Sep 6 17:08 CACHE drwxr-xr-x. 2 mailman mailman 39 Sep 6 15:48 css drwxr-xr-x. 5 mailman mailman 38 Sep 6 15:48 django_extensions drwxr-xr-x. 5 mailman mailman 38 Sep 6 15:48 django-mailman3 drwxr-xr-x. 6 mailman mailman 51 Sep 6 15:48 hyperkitty drwxr-xr-x. 3 mailman mailman 128 Sep 6 15:48 img drwxr-xr-x. 2 mailman mailman 62 Sep 6 15:48 js drwxr-xr-x. 8 mailman mailman 98 Sep 6 15:48 libs drwxr-xr-x. 6 mailman mailman 50 Sep 6 15:48 postorius drwxr-xr-x. 7 mailman mailman 63 Sep 6 15:48 rest_framework
/usr/lib/python3.9/site-packages/mailman_web/settings/base.py
#: The base directory for logs and database. BASE_DIR = Path('/opt/mailman/web')
#: Enable Development Mode. DEBUG = False
#: URL Configuration for Django ROOT_URLCONF = 'mailman_web.urls'
#: Default path where static files will be placed. STATIC_ROOT = '/opt/mailman/web/static' #: URL prefix for static files. #: Example: "http://example.com/static/", "http://static.example.com/" STATIC_URL = '/static/'
...
/usr/lib/python3.9/site-packages/mailman_web/settings/mailman.py
BASE_DIR = Path('/opt/mailman/web')
#: Mailman Core default API Path MAILMAN_REST_API_URL = 'http://localhost:8001'
#: Base URL where Django/Mailman-web would be listening for requests. Used by #: Mailman Core for fetching templates. POSTORIUS_TEMPLATE_BASE_URL = 'http://localhost:8000' ...
Why dont static files get found ? If I set Debug = True then static files are getting found. Why ? But in production mode Debug should be set False. How to solve static files problem in production ?
If you installed Mailman3 using your Distros packages, then check this: https://wiki.list.org/x/12812344 Otherwise you could follow this HOWTO: https://docs.mailman3.org/en/latest/install/virtualenv.html and it may work easily.
-- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254 7 3200 0004/+254 7 2274 3223 In an Internet failure case, the #1 suspect is a constant: DNS. "Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-) [How to ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html]
On 9/9/24 07:18, Anatoly Oreshkin wrote:
I have installed Mailman3 Core 3.3.8 + Mailman Web from AlmaLinux 9 distro. I have problems with static files in Mailman Web.
First, this list is for Mailman 2.1. The appropriate list for Mailman 3 is mailman-users@mailman3.org <https://lists.mailman3.org/mailman3/lists/mailman-users@mailman3.org/>
After starting development server at http://127.0.0.1:8000/
DJANGO_SETTINGS_MODULE= settings MAILMAN_WEB_CONFIG= /etc/mailman3/settings.py PYTHONPATH= /etc/mailman3
I'm pointiong browser on http://127.0.0.1:8000/ address and getting intitial Mailman Web page like this:
You need to access Mailman via a web server that proxies mailman requests to 127.0.0.1:8000 and which has an alias for static/ that points to /opt/mailman/web/static.
See https://docs.mailman3.org/en/latest/install/virtualenv.html#nginx-configurat... or https://docs.mailman3.org/en/latest/install/virtualenv.html#apache-configura... for examples.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
participants (3)
-
Anatoly Oreshkin
-
Mark Sapiro
-
Odhiambo Washington