Hi, list!
As the machine I'm running Mailman on now is upgraded from Fedora 36 to 37, the Python version is upgraded from 3.10 to 3.11. How do I update Mailman in the virutal environment?
Thanks, Lars
On Thu, Apr 27, 2023 at 8:40 PM Lars Bjørndal <lars@lamasti.net> wrote:
Hi, list!
As the machine I'm running Mailman on now is upgraded from Fedora 36 to 37, the Python version is upgraded from 3.10 to 3.11. How do I update Mailman in the virutal environment?
You cannot do that, IIRC. If you need to upgrade, you create a new virtualenv based on the new Python version, then you migrate your configs and data.
Did your Mailman stop functioning?
-- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254 7 3200 0004/+254 7 2274 3223 "Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-) [How to ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html]
In that case it's just a matter of: Assuming you use /opt/mailman directory.
- mv /opt/mailman /opt/mailman.310 Install mailman afresh according to the instructions, then copy all your files from /opt/mailman.310, with the exception of the virtualenv
On Thu, Apr 27, 2023, 21:17 Lars Bjørndal <lars@lamasti.net> wrote:
[Odhiambo]
[...]
Did your Mailman stop functioning?
Oh yes!
Lars
After I've installed the venv and packages again, I get the following error when running the mailman command from within the venv:
SystemError: initialization of _psycopg raised unreported exception
How do I fix that?
Lars
On 4/27/23 11:42 AM, Lars Bjørndal wrote:
After I've installed the venv and packages again, I get the following error when running the mailman command from within the venv:
SystemError: initialization of _psycopg raised unreported exception
How do I fix that?
The first issue arises because the venv/bin/ directory contains only symlinks to a system python3, and either they broke upon the upgrade or they pointed to what is now Python 3.11 and there was some incompatibility between that python and modules in the venv.
Did you install psycopg2-binary as discussed at https://docs.mailman3.org/en/latest/install/virtualenv.html#installing-mailm...
Is the error logged in var/logs/mailman.log? If so, what's the traceback?
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Hi, Mark!
You wrote:
On 4/27/23 11:42 AM, Lars Bjørndal wrote:
After I've installed the venv and packages again, I get the following error when running the mailman command from within the venv:
SystemError: initialization of _psycopg raised unreported exception
How do I fix that?
The first issue arises because the venv/bin/ directory contains only symlinks to a system python3, and either they broke upon the upgrade or they pointed to what is now Python 3.11 and there was some incompatibility between that python and modules in the venv.
I have some symlinks:
python -> /usr/bin/python python3 -> python python3.11 -> python
Did you install psycopg2-binary as discussed at https://docs.mailman3.org/en/latest/install/virtualenv.html#installing-mailm...
Yes, I did.
Is the error logged in var/logs/mailman.log? If so, what's the traceback?
No. But the traceback is:
Traceback (most recent call last): File "/opt/mailman3/venv/bin/mailman", line 8, in <module> sys.exit(main()) ^^^^^^ File "/opt/mailman3/venv/lib64/python3.11/site-packages/click/core.py", line 1130, in __call__ return self.main(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/mailman3/venv/lib64/python3.11/site-packages/click/core.py", line 1054, in main with self.make_context(prog_name, args, **extra) as ctx: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/mailman3/venv/lib64/python3.11/site-packages/click/core.py", line 920, in make_context self.parse_args(ctx, args) File "/opt/mailman3/venv/lib64/python3.11/site-packages/click/core.py", line 1613, in parse_args rest = super().parse_args(ctx, args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/mailman3/venv/lib64/python3.11/site-packages/click/core.py", line 1378, in parse_args value, args = param.handle_parse_result(ctx, opts, args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/mailman3/venv/lib64/python3.11/site-packages/click/core.py", line 2360, in handle_parse_result value = self.process_value(ctx, value) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/mailman3/venv/lib64/python3.11/site-packages/click/core.py", line 2322, in process_value value = self.callback(ctx, self, value) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/mailman3/venv/lib64/python3.11/site-packages/mailman/bin/mailman.py", line 95, in initialize_config initialize(value) File "/opt/mailman3/venv/lib64/python3.11/site-packages/mailman/core/initialize.py", line 229, in initialize initialize_2(propagate_logs=propagate_logs) File "/opt/mailman3/venv/lib64/python3.11/site-packages/mailman/core/initialize.py", line 187, in initialize_2 config.db = getUtility(IDatabaseFactory, utility_name).create() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/mailman3/venv/lib64/python3.11/site-packages/mailman/database/factory.py", line 57, in create database.initialize() File "/opt/mailman3/venv/lib64/python3.11/site-packages/mailman/database/base.py", line 117, in initialize self.engine = create_engine( ^^^^^^^^^^^^^^ File "<string>", line 2, in create_engine File "/opt/mailman3/venv/lib64/python3.11/site-packages/sqlalchemy/util/deprecations.py", line 283, in warned return fn(*args, **kwargs) # type: ignore[no-any-return] ^^^^^^^^^^^^^^^^^^^ File "/opt/mailman3/venv/lib64/python3.11/site-packages/sqlalchemy/engine/create.py", line 601, in create_engine dbapi = dbapi_meth(**dbapi_args) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/mailman3/venv/lib64/python3.11/site-packages/sqlalchemy/dialects/postgresql/psycopg2.py", line 669, in import_dbapi import psycopg2 File "/opt/mailman3/venv/lib64/python3.11/site-packages/psycopg2/__init__.py", line 51, in <module> from psycopg2._psycopg import ( # noqa SystemError: initialization of _psycopg raised unreported exception
Do I need to upgrade the database? If so, how do I do that?
Thanks, Lars
Hi Lars,
I did the same thing this weekend (upgraded mailman to latest and python from 3.7 to 3.11) as part of a process to do some work I've promised Mark :-)
Here are my notes (to I can repeat it next time). I'm on Debian 10. My mailman install is based on Brian Carpenters install notes: https://wiki.list.org/DOC/Howto_Install_Mailman3_On_Debian10
- IF UPGRADING: copy /static folder, /venv folder and base config files to new backup folder (e.g. config_bak)
- Install desired python e.g 3.11 (from source if necessary) and be sure to include: apt install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev
- IF UPGRADING: Stop the mailman related services: systemctl stop mailman qcluster gunicorn
- Create local venv at: python3.11 -m venv /opt/mailman/mm/venv (backup old one first to backup folder)
- Set ownership of venv folder and subfolders/files: chown -R mailman.mailman venv
- Switch to owner: su mailman
- Activate venv: source /opt/mailman/mm/venv/bin/activate
- Check pip uses the intended python version: pip -V
- Upgrade PIP if necessary: pip install --upgrade pip
- Install mailman3 basics: pip install --upgrade mailman hyperkitty postorius
- Install additional if missing: pip install --upgrade django-mailman3 mailmanclient mailman-hyperkitty
- Install DB connector: pip install pylibmc psycopg2 python3-psycopg2 python3-pil python3-psycopg2 whoosh python3-whoosh python3-httplib2
- Update /opt/mailman/mm/urls.py with desired paths (django)
- IF UPGRADING RUN: bin/django-admin migrate PLUS: bin/mailman-post-update (or individually below) bin/django-admin collectstatic --clear --noinput --verbosity 0 bin/django-admin compress bin/django-admin compilemessages
- Exit venv environment: deactivate and Exit mailman user: exit
- Start mailman: systemctl start mailman (check status: systemctl status mailman.service)
- Start qrunner: systemctl start qcluster (check status: systemctl status qcluster.service)
- Start gunicorn: systemctl start gunicorn (check status: systemctl status gunicorn.service)
Note:
- /django-admin is the same as /mailman-web in some installation notes.
- The bin/mailman-post-update script Brian used does everything except the "migrate" step
- I don't know if all the pip psycopg2/whoosh modules are needed - I didn't take the chance.
- My system now uses django 4.1.8 so I didn't need to worry about the psycopg2-binary install (I don't think I did - it seems to all work)
- The 3.8 release notes contain a breaking change with the postgresql connection command. I changed that before upgrading. (assuming you are using postgresql!)
- What I haven't covered here is checking the autostart, service settings and crons are working as that is in the documentation and may already/still be running on your server.
Hope that helps :-)
Cheers,
Duane
This is too complicated.
On Thu, Apr 27, 2023, 23:00 Duane Raymond <duane@fairsay.com> wrote:
Hi Lars,
I did the same thing this weekend (upgraded mailman to latest and python from 3.7 to 3.11) as part of a process to do some work I've promised Mark :-)
Here are my notes (to I can repeat it next time). I'm on Debian 10. My mailman install is based on Brian Carpenters install notes: https://wiki.list.org/DOC/Howto_Install_Mailman3_On_Debian10
- IF UPGRADING: copy /static folder, /venv folder and base config files to new backup folder (e.g. config_bak)
- Install desired python e.g 3.11 (from source if necessary) and be sure to include: apt install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev
- IF UPGRADING: Stop the mailman related services: systemctl stop mailman qcluster gunicorn
- Create local venv at: python3.11 -m venv /opt/mailman/mm/venv (backup old one first to backup folder)
- Set ownership of venv folder and subfolders/files: chown -R mailman.mailman venv
- Switch to owner: su mailman
- Activate venv: source /opt/mailman/mm/venv/bin/activate
- Check pip uses the intended python version: pip -V
- Upgrade PIP if necessary: pip install --upgrade pip
- Install mailman3 basics: pip install --upgrade mailman hyperkitty postorius
- Install additional if missing: pip install --upgrade django-mailman3 mailmanclient mailman-hyperkitty
- Install DB connector: pip install pylibmc psycopg2 python3-psycopg2 python3-pil python3-psycopg2 whoosh python3-whoosh python3-httplib2
- Update /opt/mailman/mm/urls.py with desired paths (django)
- IF UPGRADING RUN: bin/django-admin migrate PLUS: bin/mailman-post-update (or individually below) bin/django-admin collectstatic --clear --noinput --verbosity 0 bin/django-admin compress bin/django-admin compilemessages
- Exit venv environment: deactivate and Exit mailman user: exit
- Start mailman: systemctl start mailman (check status: systemctl status mailman.service)
- Start qrunner: systemctl start qcluster (check status: systemctl status qcluster.service)
- Start gunicorn: systemctl start gunicorn (check status: systemctl status gunicorn.service)
Note:
- /django-admin is the same as /mailman-web in some installation notes.
- The bin/mailman-post-update script Brian used does everything except the "migrate" step
- I don't know if all the pip psycopg2/whoosh modules are needed - I didn't take the chance.
- My system now uses django 4.1.8 so I didn't need to worry about the psycopg2-binary install (I don't think I did - it seems to all work)
- The 3.8 release notes contain a breaking change with the postgresql connection command. I changed that before upgrading. (assuming you are using postgresql!)
- What I haven't covered here is checking the autostart, service settings and crons are working as that is in the documentation and may already/still be running on your server.
Hope that helps :-)
Cheers,
Duane
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/ Archived at: https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/message/...
This message sent to odhiambo@gmail.com
2023-04-28 05:10 に Odhiambo Washington さんは書きました:
This is too complicated.
Please be a little more helpful. As is, it's ambiguous. If you mean *too complicated* because there's a simpler way, explain. If you mean "too complicated* because you didn't understand, be more specific. If you mean "too complicated* because you think Mailman should provide a utility to do it to make life easier for typical admisn, we'll happily reply "file an RFE, patches welcome". ;-) if you mean *too complicated* because email sux[tm], boy, do *we* have stories! :-) And if you were just ranting, add a smiley. Email does suck, and sometimes you need to rant among the fellowship. :-)
TBH, it looked pretty clean to me; it's just a long *very* precise checklist -- I'm saving it, although Mark will probably turn it into a FAQ before I do anything with it. But I'm not going to insist on that POV, I've been doing Mailman since 1997 so I'm not exactly tuned in to the typical admin POV any more. A bit warped, maybe. :-D
Your symlimks don't make sense to me. And BTW why do you need symlimks in the first place? Your new virtualenv should be purely a Python3.11 instance. I don't see such an error in my staging environment which is identical to yours. Did you do a fresh install then migrate the data as I proposed earlier?
On Thu, Apr 27, 2023, 22:19 Lars Bjørndal <lars@lamasti.net> wrote:
Hi, Mark!
You wrote:
On 4/27/23 11:42 AM, Lars Bjørndal wrote:
After I've installed the venv and packages again, I get the following error when running the mailman command from within the venv:
SystemError: initialization of _psycopg raised unreported exception
How do I fix that?
The first issue arises because the venv/bin/ directory contains only symlinks to a system python3, and either they broke upon the upgrade or they pointed to what is now Python 3.11 and there was some incompatibility between that python and modules in the venv.
I have some symlinks:
python -> /usr/bin/python python3 -> python python3.11 -> python
Did you install psycopg2-binary as discussed at https://docs.mailman3.org/en/latest/install/virtualenv.html#installing-mailm...
Yes, I did.
Is the error logged in var/logs/mailman.log? If so, what's the traceback?
No. But the traceback is:
Traceback (most recent call last): File "/opt/mailman3/venv/bin/mailman", line 8, in <module> sys.exit(main()) ^^^^^^ File "/opt/mailman3/venv/lib64/python3.11/site-packages/click/core.py", line 1130, in __call__ return self.main(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/mailman3/venv/lib64/python3.11/site-packages/click/core.py", line 1054, in main with self.make_context(prog_name, args, **extra) as ctx: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/mailman3/venv/lib64/python3.11/site-packages/click/core.py", line 920, in make_context self.parse_args(ctx, args) File "/opt/mailman3/venv/lib64/python3.11/site-packages/click/core.py", line 1613, in parse_args rest = super().parse_args(ctx, args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/mailman3/venv/lib64/python3.11/site-packages/click/core.py", line 1378, in parse_args value, args = param.handle_parse_result(ctx, opts, args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/mailman3/venv/lib64/python3.11/site-packages/click/core.py", line 2360, in handle_parse_result value = self.process_value(ctx, value) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/mailman3/venv/lib64/python3.11/site-packages/click/core.py", line 2322, in process_value value = self.callback(ctx, self, value) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/mailman3/venv/lib64/python3.11/site-packages/mailman/bin/mailman.py", line 95, in initialize_config initialize(value) File "/opt/mailman3/venv/lib64/python3.11/site-packages/mailman/core/initialize.py", line 229, in initialize initialize_2(propagate_logs=propagate_logs) File "/opt/mailman3/venv/lib64/python3.11/site-packages/mailman/core/initialize.py", line 187, in initialize_2 config.db = getUtility(IDatabaseFactory, utility_name).create() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/mailman3/venv/lib64/python3.11/site-packages/mailman/database/factory.py", line 57, in create database.initialize() File "/opt/mailman3/venv/lib64/python3.11/site-packages/mailman/database/base.py", line 117, in initialize self.engine = create_engine( ^^^^^^^^^^^^^^ File "<string>", line 2, in create_engine File "/opt/mailman3/venv/lib64/python3.11/site-packages/sqlalchemy/util/deprecations.py", line 283, in warned return fn(*args, **kwargs) # type: ignore[no-any-return] ^^^^^^^^^^^^^^^^^^^ File "/opt/mailman3/venv/lib64/python3.11/site-packages/sqlalchemy/engine/create.py", line 601, in create_engine dbapi = dbapi_meth(**dbapi_args) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/mailman3/venv/lib64/python3.11/site-packages/sqlalchemy/dialects/postgresql/psycopg2.py", line 669, in import_dbapi import psycopg2 File "/opt/mailman3/venv/lib64/python3.11/site-packages/psycopg2/__init__.py", line 51, in <module> from psycopg2._psycopg import ( # noqa SystemError: initialization of _psycopg raised unreported exception
Do I need to upgrade the database? If so, how do I do that?
Thanks, Lars
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/ Archived at: https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/message/...
This message sent to odhiambo@gmail.com
On 4/27/23 1:03 PM, Odhiambo Washington wrote:
Your symlimks don't make sense to me. And BTW why do you need symlimks in the first place?
It's the way virtualenvs work. They don't install the Python interpreter in the venv. They just symlink to the appropriate Python interpreter in the system.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
On 4/27/23 12:18 PM, Lars Bjørndal wrote:
No. But the traceback is:
Traceback (most recent call last):
...
File "/opt/mailman3/venv/lib64/python3.11/site-packages/sqlalchemy/dialects/postgresql/psycopg2.py", line 669, in import_dbapi import psycopg2 File "/opt/mailman3/venv/lib64/python3.11/site-packages/psycopg2/__init__.py", line 51, in <module> from psycopg2._psycopg import ( # noqa SystemError: initialization of _psycopg raised unreported exception
Do I need to upgrade the database? If so, how do I do that?
This appears to be an issue with psycopg2 itself.
What happens if you activate your venv and do
python -c 'import psycopg2'
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
[Mark]
This appears to be an issue with psycopg2 itself.
What happens if you activate your venv and do
python -c 'import psycopg2'
Traceback (most recent call last): File "<string>", line 1, in <module> File "/opt/mailman3/venv/lib64/python3.11/site-packages/psycopg2/__init__.py", line 51, in <module> from psycopg2._psycopg import ( # noqa SystemError: initialization of _psycopg raised unreported exception
Lars
On 4/27/23 1:15 PM, Lars Bjørndal wrote:
[Mark]
This appears to be an issue with psycopg2 itself.
What happens if you activate your venv and do
python -c 'import psycopg2'
Traceback (most recent call last): File "<string>", line 1, in <module> File "/opt/mailman3/venv/lib64/python3.11/site-packages/psycopg2/__init__.py", line 51, in <module> from psycopg2._psycopg import ( # noqa SystemError: initialization of _psycopg raised unreported exception
Your psycopg2 installation is broken. Try to pip uninstall
it and then
install again.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
[Mark]
Your psycopg2 installation is broken. Try to
pip uninstall
it and then install again.
Thanks, that worked.
When running django-admin migrate
, I get the following:
Traceback (most recent call last): File "/opt/mailman3/venv/bin/django-admin", line 8, in <module> sys.exit(execute_from_command_line()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/mailman3/venv/lib64/python3.11/site-packages/django/core/management/__init__.py", line 446, in execute_from_command_line utility.execute() File "/opt/mailman3/venv/lib64/python3.11/site-packages/django/core/management/__init__.py", line 440, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/opt/mailman3/venv/lib64/python3.11/site-packages/django/core/management/base.py", line 402, in run_from_argv self.execute(*args, **cmd_options) File "/opt/mailman3/venv/lib64/python3.11/site-packages/django/core/management/base.py", line 448, in execute output = self.handle(*args, **options) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/mailman3/venv/lib64/python3.11/site-packages/django/core/management/base.py", line 93, in wrapped saved_locale = translation.get_language() ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/mailman3/venv/lib64/python3.11/site-packages/django/utils/translation/__init__.py", line 210, in get_language return _trans.get_language() ^^^^^^^^^^^^^^^^^^^ File "/opt/mailman3/venv/lib64/python3.11/site-packages/django/utils/translation/__init__.py", line 65, in __getattr__ if settings.USE_I18N: ^^^^^^^^^^^^^^^^^ File "/opt/mailman3/venv/lib64/python3.11/site-packages/django/conf/__init__.py", line 92, in __getattr__ self._setup(name) File "/opt/mailman3/venv/lib64/python3.11/site-packages/django/conf/__init__.py", line 72, in _setup raise ImproperlyConfigured( django.core.exceptions.ImproperlyConfigured: Requested setting USE_I18N, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.
How could that be fixed?
Lars
On 4/27/23 11:13 PM, Lars Bjørndal wrote:
When running
django-admin migrate
, I get the following:Traceback (most recent call last):
...
django.core.exceptions.ImproperlyConfigured: Requested setting USE_I18N, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.
How could that be fixed?
Your django-admin command is not finding your settings.py file. Either run it with a --pythonpath argument naming the directory that contains settings.py or set the environment PYTHONPATH to that directory.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
[Mark]
On 4/27/23 11:13 PM, Lars Bjørndal wrote:
When running
django-admin migrate
, I get the following:Traceback (most recent call last):
...
django.core.exceptions.ImproperlyConfigured: Requested setting USE_I18N, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.
How could that be fixed?
Your django-admin command is not finding your settings.py file.
Do you mean /etc/mailman3/ where settings.py lives?
Either run it with a --pythonpath argument naming the directory that contains settings.py or set the environment PYTHONPATH to that directory.
I tried django-admin migrate --pythonpath /etc/mailman3
, and got the same result.
Thanks, Lars
On 4/28/23 11:07, Lars Bjørndal wrote:
[Mark]
Your django-admin command is not finding your settings.py file.
Do you mean /etc/mailman3/ where settings.py lives?
Yes.
Either run it with a --pythonpath argument naming the directory that contains settings.py or set the environment PYTHONPATH to that directory.
I tried
django-admin migrate --pythonpath /etc/mailman3
, and got the same result.
Then you may need
django-admin migrate --pythonpath /etc/mailman3 --settings settings
What I have is this shell file that I use to invoke django-admin
#!/bin/bash
. /opt/mailman/mm/venv/bin/activate
cd /opt/mailman/mm
export PYTHONPATH=/opt/mailman/mm
export DJANGO_SETTINGS_MODULE=settings
django-admin $@
Of course the paths in the above are specific to my installation and would be different for you.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Thank you very much. You wrote:
[...]
I tried
django-admin migrate --pythonpath /etc/mailman3
, and got the same result.Then you may need
django-admin migrate --pythonpath /etc/mailman3 --settings settings
Yes, that worked!
What I have is this shell file that I use to invoke django-admin
#!/bin/bash . /opt/mailman/mm/venv/bin/activate cd /opt/mailman/mm export PYTHONPATH=/opt/mailman/mm
So you have settings.py in /opt/mailman/mm rather than in /etc/mailman3?
export DJANGO_SETTINGS_MODULE=settings django-admin $@
Thanks Lars
On Sat, Apr 29, 2023 at 8:25 AM Lars Bjørndal <lars@lamasti.net> wrote:
Thank you very much. You wrote:
[...]
I tried
django-admin migrate --pythonpath /etc/mailman3
, and got the same result.Then you may need
django-admin migrate --pythonpath /etc/mailman3 --settings settings
Yes, that worked!
What I have is this shell file that I use to invoke django-admin
#!/bin/bash . /opt/mailman/mm/venv/bin/activate cd /opt/mailman/mm export PYTHONPATH=/opt/mailman/mm
So you have settings.py in /opt/mailman/mm rather than in /etc/mailman3?
That's right - based on an earlier installation method before the official virtualenv <https://docs.mailman3.org/en/latest/install/virtualenv.html#virtualenv-install> one was put together, and that's why he has that shell file. For a virtualenv <https://docs.mailman3.org/en/latest/install/virtualenv.html#virtualenv-install> setup, your settings should live in /etc/mailman3 as stated.
-- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254 7 3200 0004/+254 7 2274 3223 "Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-) [How to ask smart questions: http://www.catb.org/~esr/faqs/smart-questions.html]
On 4/29/23 01:44, Odhiambo Washington wrote:
On Sat, Apr 29, 2023 at 8:25 AM Lars Bjørndal <lars@lamasti.net> wrote:
So you have settings.py in /opt/mailman/mm rather than in /etc/mailman3?
That's right - based on an earlier installation method before the official virtualenv <https://docs.mailman3.org/en/latest/install/virtualenv.html#virtualenv-install> one was put together, and that's why he has that shell file. For a virtualenv <https://docs.mailman3.org/en/latest/install/virtualenv.html#virtualenv-install> setup, your settings should live in /etc/mailman3 as stated.
If you are interested in background on prior installation methods and their evolution, see https://wiki.list.org/x/17891998
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
Thanks to all! My installation now works again.
Lars
On Sat, Apr 29, 2023 at 11:44:34AM +0300, Odhiambo Washington wrote:
On Sat, Apr 29, 2023 at 8:25 AM Lars Bjørndal <lars@lamasti.net> wrote:
Thank you very much. You wrote:
[...]
I tried
django-admin migrate --pythonpath /etc/mailman3
, and got the same result.Then you may need
django-admin migrate --pythonpath /etc/mailman3 --settings settings
Yes, that worked!
What I have is this shell file that I use to invoke django-admin
#!/bin/bash . /opt/mailman/mm/venv/bin/activate cd /opt/mailman/mm export PYTHONPATH=/opt/mailman/mm
So you have settings.py in /opt/mailman/mm rather than in /etc/mailman3?
That's right - based on an earlier installation method before the official virtualenv <https://docs.mailman3.org/en/latest/install/virtualenv.html#virtualenv-install> one was put together, and that's why he has that shell file. For a virtualenv <https://docs.mailman3.org/en/latest/install/virtualenv.html#virtualenv-install> setup, your settings should live in /etc/mailman3 as stated.
-- Best regards, Odhiambo WASHINGTON, Nairobi,KE +254 7 3200 0004/+254 7 2274 3223 "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@mailman3.org To unsubscribe send an email to mailman-users-leave@mailman3.org https://lists.mailman3.org/mailman3/lists/mailman-users.mailman3.org/ Archived at: https://lists.mailman3.org/archives/list/mailman-users@mailman3.org/message/...
This message sent to lars@lamasti.net
participants (5)
-
Duane Raymond
-
Lars Bjørndal
-
Mark Sapiro
-
Odhiambo Washington
-
turnbull