On Mon, Sep 9, 2024 at 5:24 PM Anatoly Oreshkin <anatoly.oresh...@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]
------------------------------------------------------
Mailman-Users mailing list -- mailman-users@python.org
To unsubscribe send an email to mailman-users-le...@python.org
https://mail.python.org/mailman3/lists/mailman-users.python.org/
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: https://www.mail-archive.com/mailman-users@python.org/
    https://mail.python.org/archives/list/mailman-users@python.org/
Member address: arch...@mail-archive.com

Reply via email to