Hi,
I try to install Postorius, but I don't find the file postorius.wsgi. Where should I get it please?
This is, what I've done so far:
- git clone https://gitlab.com/mailman/postorius.git
- cd postorius
- python3 setup.py install
- cd example_project
- virtualenv venv
- . venv/bin/activate
- pip3 install -r requirements.txt
- in venv/lib/python3.6/site-packages/django_mailman3/lib/mailman.py: replace "urllib2" by "urllib.error"
- python3 manage.py migrate
- python3 manage.py createsuperuser
- python3 manage.py compilemessages
- python3 manage.py collectstatic
Now I try to follow https://postorius.readthedocs.io/en/latest/deployment.html#apache-with-mod-w... but I don't find postorius.wsgi ...
TIA for any help. Kind regards,
Peter
Peter,
You need to install uwsgi or antoher wsgi service and setup the socket for apache/django to speak to each other through.
In mine, I use uwsgi service, configured and pointed it to the wsgi-file in the postorius django project. Then pointed nginx (I don't use apache, but same difference) to the uwsgi socket I created. It was actually one of the trickiest parts of the setup (it can be strict about how it expects the Django modules to be "advertised" back to the web server). And then did the same thing for hyperkitty (it and postorius are on separate wsgi sockets).
Sincerely,
Andrew Hodder Systems Administrator Support Operations, Afilias E-mail: drew@afilias.info Phone: +1 416.673.4164 Fax: +1 416.646.1541
On Thu, Jan 25, 2018 at 8:27 AM, Peter Münster <pmlists@free.fr> wrote:
Hi,
I try to install Postorius, but I don't find the file postorius.wsgi. Where should I get it please?
This is, what I've done so far:
- git clone https://gitlab.com/mailman/postorius.git
- cd postorius
- python3 setup.py install
- cd example_project
- virtualenv venv
- . venv/bin/activate
- pip3 install -r requirements.txt
- in venv/lib/python3.6/site-packages/django_mailman3/lib/mailman.py: replace "urllib2" by "urllib.error"
- python3 manage.py migrate
- python3 manage.py createsuperuser
- python3 manage.py compilemessages
- python3 manage.py collectstatic
Now I try to follow https://postorius.readthedocs.io/en/latest/deployment.html# apache-with-mod-wsgi but I don't find postorius.wsgi ...
TIA for any help. Kind regards,
Peter
Mailman-users mailing list mailman-users@mailman3.org https://lists.mailman3.org/mailman3/lists/mailman-users.mailman3.org/
On 01/25/2018 05:27 AM, Peter Münster wrote:
This is, what I've done so far:
- git clone https://gitlab.com/mailman/postorius.git
- cd postorius
...
Now I try to follow https://postorius.readthedocs.io/en/latest/deployment.html#apache-with-mod-w... but I don't find postorius.wsgi ...
It's got a different name. It's in the above directory, at example_project/wsgi.py
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
On Thu, Jan 25 2018, Mark Sapiro wrote:
It's got a different name. It's in the above directory, at example_project/wsgi.py
Thank you. Unfortunately, it does not work...
First I tried with python-3 (installed package was "apache2-mod_wsgi-python3"), but I got this error:
Invalid command 'WSGIScriptAlias', perhaps misspelled or defined by a module n...ration
Then, I tried with python-2 (installed package is now "apache2-mod_wsgi"), and this is the error message of apache:
mod_wsgi (pid=18880): Target WSGI script '/srv/www/htdocs/ckc3r/postorius/example_project/wsgi.py' cannot be loaded as Python module. mod_wsgi (pid=18880): Exception occurred processing WSGI script '/srv/www/htdocs/ckc3r/postorius/example_project/wsgi.py'. Traceback (most recent call last): File "/srv/www/htdocs/ckc3r/postorius/example_project/wsgi.py", line 16, in <module> application = get_wsgi_application() File "/usr/lib/python2.7/site-packages/django/core/wsgi.py", line 14, in get_wsgi_application django.setup() File "/usr/lib/python2.7/site-packages/django/__init__.py", line 17, in setup configure_logging(settings.LOGGING_CONFIG, settings.LOGGING) File "/usr/lib/python2.7/site-packages/django/conf/__init__.py", line 48, in __getattr__ self._setup(name) File "/usr/lib/python2.7/site-packages/django/conf/__init__.py", line 44, in _setup self._wrapped = Settings(settings_module) File "/usr/lib/python2.7/site-packages/django/conf/__init__.py", line 92, in __init__ mod = importlib.import_module(self.SETTINGS_MODULE) File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module __import__(name) ImportError: No module named settings
Could you help me please, to get Postorius working (and later also HyperKitty...)?
TIA for your efforts,
Peter
On Fri, Jan 26 2018, Peter Münster wrote:
ImportError: No module named settings
Ok, I've found the solution:
In wsgi.py:
import sys sys.path.append('/srv/www/htdocs/ckc3r/postorius/example_project')
But now, I get another error:
File "/usr/lib/python2.7/site-packages/postorius-1.1.2-py2.7.egg/postorius/views/rest.py", line 33, in <module> from django_mailman3.lib.scrub import Scrubber File "/usr/lib/python2.7/site-packages/django_mailman3-1.2.0a1-py2.7.egg/django_mailman3/lib/scrub.py", line 26, in <module> from email.message import EmailMessage ImportError: cannot import name EmailMessage
What should I do please?
TIA,
Peter
On Fri, Jan 26 2018, Peter Münster wrote:
ImportError: cannot import name EmailMessage
What should I do please?
Ok, found it. This patch is needed: --8<---------------cut here---------------start------------->8--- --- /usr/lib/python2.7/site-packages/django_mailman3-1.2.0a1-py2.7.egg/django_mailman3/lib/scrub.py~ 2018-01-26 08:43:30.027617074 +0100 +++ /usr/lib/python2.7/site-packages/django_mailman3-1.2.0a1-py2.7.egg/django_mailman3/lib/scrub.py 2018-01-26 11:37:08.737066069 +0100 @@ -23,7 +23,7 @@ from mimetypes import guess_all_extensions from email.errors import HeaderParseError from email.header import make_header, decode_header -from email.message import EmailMessage +from email.message import Message # Path characters for common platforms PRE = re.compile(r'[/\\:]') @@ -63,7 +63,7 @@ sanitize = Sanitize.SANITIZE_HTML def __init__(self, msg): - assert isinstance(msg, EmailMessage) + assert isinstance(msg, Message) self.msg = msg def scrub(self): --8<---------------cut here---------------end--------------->8--- -- Peter
On 01/26/2018 11:18 AM, Peter Münster wrote:
On Fri, Jan 26 2018, Peter Münster wrote:
ImportError: No module named settings Ok, I've found the solution:
In wsgi.py:
import sys sys.path.append('/srv/www/htdocs/ckc3r/postorius/example_project')
But now, I get another error:
File "/usr/lib/python2.7/site-packages/postorius-1.1.2-py2.7.egg/postorius/views/rest.py", line 33, in <module> from django_mailman3.lib.scrub import Scrubber File "/usr/lib/python2.7/site-packages/django_mailman3-1.2.0a1-py2.7.egg/django_mailman3/lib/scrub.py", line 26, in <module> from email.message import EmailMessage ImportError: cannot import name EmailMessage
What should I do please? You appear to be using a prerelease version of django-mailman3 which is not compatible with the other parts. Install an earlier version and it should work.
You also appeared to have used Python3 for the frontend in earlier posts. Currently Python3 is not yet supported. The next stable releases will most likely support Python3 and drop support for Python2
On Fri, Jan 26 2018, Simon Hanna wrote:
from email.message import EmailMessage
ImportError: cannot import name EmailMessage
You appear to be using a prerelease version of django-mailman3 which is not compatible with the other parts. Install an earlier version and it should work.
Hi,
I did not install it. I guess, it has been installed automatically by the command "pip2 install -r requirements.txt" or similar.
Anyway, with my patch (EmailMessage -> Message) it works.
I just needed to fiddle about some dependency issues. These commands were needed in the end: pip2 install djangorestframework==3.7.3 pip2 install cryptography==1.8.2 pip2 install pyOpenSSL==16.2.0
You also appeared to have used Python3 for the frontend in earlier posts.
Yes, first I tried it, but now I use Python2 for any Django related things (HyperKitty and Postorius).
Kind regards,
Peter
Hi Peter,
I use https://gitlab.com/mailman/mailman-suite as WSGI backend for httpd
# git clone https://gitlab.com/mailman/mailman-suite.git
You have to customize settings.py of mailman-suite before you can start using it.
Regards
Timm
Am Donnerstag, den 25.01.2018, 14:27 +0100 schrieb Peter Münster:
Hi,
I try to install Postorius, but I don't find the file postorius.wsgi. Where should I get it please?
This is, what I've done so far:
- git clone https://gitlab.com/mailman/postorius.git
- cd postorius
- python3 setup.py install
- cd example_project
- virtualenv venv
- . venv/bin/activate
- pip3 install -r requirements.txt
- in venv/lib/python3.6/site-packages/django_mailman3/lib/mailman.py: replace "urllib2" by "urllib.error"
- python3 manage.py migrate
- python3 manage.py createsuperuser
- python3 manage.py compilemessages
- python3 manage.py collectstatic
Now I try to follow https://postorius.readthedocs.io/en/latest/deployment.html#apache-wit h-mod-wsgi but I don't find postorius.wsgi ...
TIA for any help. Kind regards,
On Fri, Jan 26 2018, Timm Stamer wrote:
I use https://gitlab.com/mailman/mailman-suite as WSGI backend for httpd
# git clone https://gitlab.com/mailman/mailman-suite.git
You have to customize settings.py of mailman-suite before you can start using it.
Thanks. Unfortunately, it seems, that settings.py is not found:
mod_wsgi (pid=22182): Target WSGI script '/srv/www/htdocs/ckc3r/mailman-suite/mailman-suite_project/wsgi.py' cannot be loaded as Python module. mod_wsgi (pid=22182): Exception occurred processing WSGI script '/srv/www/htdocs/ckc3r/mailman-suite/mailman-suite_project/wsgi.py'. Traceback (most recent call last): [...] File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module __import__(name) ImportError: No module named settings
Any hints?
TIA for your help,
Peter
participants (5)
-
Andrew Hodder
-
Mark Sapiro
-
Peter Münster
-
Simon Hanna
-
Timm Stamer