problem with postorius initial setup
Hi. I am trying to setup postorius, but I have run into a problem. I am using the example project, except I am using postgresql instead of sqlite3. I ran python manage.py migrate which was successful.
On running the development server I get: Exception in thread django-main-thread: Traceback (most recent call last): File "/usr/lib/python3.8/site-packages/django/utils/module_loading.py", line 20, in import_string return getattr(module, class_name) AttributeError: module 'postorius.middleware' has no attribute 'APICountingMiddleware'
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/usr/lib/python3.8/site-packages/django/core/servers/basehttp.py", line 45, in get_internal_wsgi_application return import_string(app_path) File "/usr/lib/python3.8/site-packages/django/utils/module_loading.py", line 17, in import_string module = import_module(module_path) File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1014, in _gcd_import File "<frozen importlib._bootstrap>", line 991, in _find_and_load File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 671, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 783, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "/home/covici/mailman_django/example_project/wsgi.py", line 17, in <module> application = get_wsgi_application() File "/usr/lib/python3.8/site-packages/django/core/wsgi.py", line 13, in get_wsgi_application return WSGIHandler() File "/usr/lib/python3.8/site-packages/django/core/handlers/wsgi.py", line 127, in __init__ self.load_middleware() File "/usr/lib/python3.8/site-packages/django/core/handlers/base.py", line 40, in load_middleware middleware = import_string(middleware_path) File "/usr/lib/python3.8/site-packages/django/utils/module_loading.py", line 22, in import_string raise ImportError('Module "%s" does not define a "%s" attribute/class' % ( ImportError: Module "postorius.middleware" does not define a "APICountingMiddleware" attribute/class
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner self.run() File "/usr/lib/python3.8/threading.py", line 870, in run self._target(*self._args, **self._kwargs) File "/usr/lib/python3.8/site-packages/django/utils/autoreload.py", line 53, in wrapper fn(*args, **kwargs) File "/usr/lib/python3.8/site-packages/django/core/management/commands/runserver.py", line 138, in inner_run handler = self.get_handler(*args, **options) File "/usr/lib/python3.8/site-packages/django/contrib/staticfiles/management/commands/runserver.py", line 27, in get_handler handler = super().get_handler(*args, **options) File "/usr/lib/python3.8/site-packages/django/core/management/commands/runserver.py", line 65, in get_handler return get_internal_wsgi_application() File "/usr/lib/python3.8/site-packages/django/core/servers/basehttp.py", line 47, in get_internal_wsgi_application raise ImproperlyConfigured( django.core.exceptions.ImproperlyConfigured: WSGI application 'wsgi.application' could not be loaded; Error importing module.
Thanks in advance for any suggestions.
-- Your life is like a penny. You're going to lose it. The question is: How do you spend it?
John Covici wb2una
covici@ccs.covici.com
John Covici writes:
Hi. I am trying to setup postorius, but I have run into a problem. I am using the example project, except I am using postgresql instead of sqlite3. I ran python manage.py migrate which was successful.
On running the development server I get: Exception in thread django-main-thread: Traceback (most recent call last): File "/usr/lib/python3.8/site-packages/django/utils/module_loading.py", line 20, in import_string return getattr(module, class_name) AttributeError: module 'postorius.middleware' has no attribute 'APICountingMiddleware'
This appears to be another version mismatch. The APICountingMiddleware appears to be a debugging or development instrumentation tool. It was added on 2021-02-28, so it's very recent. Somehow your Postorius settings.py is newer than your Postorius middleware.py. I would guess you have checked out or pip'ed a very recent version of Postorius but the example_project is picking up an older version, possibly from the Gentoo package. Why that could happen depends on whether you've set up a venv for the up-to-date Postorius, whether it's active, and so on.
Steve
On Tue, 16 Mar 2021 12:14:36 -0400, Stephen J. Turnbull wrote:
John Covici writes:
Hi. I am trying to setup postorius, but I have run into a problem. I am using the example project, except I am using postgresql instead of sqlite3. I ran python manage.py migrate which was successful.
On running the development server I get: Exception in thread django-main-thread: Traceback (most recent call last): File "/usr/lib/python3.8/site-packages/django/utils/module_loading.py", line 20, in import_string return getattr(module, class_name) AttributeError: module 'postorius.middleware' has no attribute 'APICountingMiddleware'
This appears to be another version mismatch. The APICountingMiddleware appears to be a debugging or development instrumentation tool. It was added on 2021-02-28, so it's very recent. Somehow your Postorius settings.py is newer than your Postorius middleware.py. I would guess you have checked out or pip'ed a very recent version of Postorius but the example_project is picking up an older version, possibly from the Gentoo package. Why that could happen depends on whether you've set up a venv for the up-to-date Postorius, whether it's active, and so on.
I think I know what is happening, but not how to fix. The example_project which the docs told me to get is from the postorius git which is, of course, recent, whereas the postorius I have from the gentoo package is 1.3.3, which is not that old, but maybe not up to the git version. Should I be using the git version?
-- Your life is like a penny. You're going to lose it. The question is: How do you spend it?
John Covici wb2una
covici@ccs.covici.com
-- thanks, Abhilash Raj (maxking)
On Mar 16, 2021, at 11:35 AM, John Covici <covici@ccs.covici.com> wrote:
On Tue, 16 Mar 2021 12:14:36 -0400, Stephen J. Turnbull wrote:
John Covici writes:
Hi. I am trying to setup postorius, but I have run into a problem. I am using the example project, except I am using postgresql instead of sqlite3. I ran python manage.py migrate which was successful.
On running the development server I get: Exception in thread django-main-thread: Traceback (most recent call last): File "/usr/lib/python3.8/site-packages/django/utils/module_loading.py", line 20, in import_string return getattr(module, class_name) AttributeError: module 'postorius.middleware' has no attribute 'APICountingMiddleware'
This appears to be another version mismatch. The APICountingMiddleware appears to be a debugging or development instrumentation tool. It was added on 2021-02-28, so it's very recent. Somehow your Postorius settings.py is newer than your Postorius middleware.py. I would guess you have checked out or pip'ed a very recent version of Postorius but the example_project is picking up an older version, possibly from the Gentoo package. Why that could happen depends on whether you've set up a venv for the up-to-date Postorius, whether it's active, and so on.
I think I know what is happening, but not how to fix. The example_project which the docs told me to get is from the postorius git which is, of course, recent, whereas the postorius I have from the gentoo package is 1.3.3, which is not that old, but maybe not up to the git version. Should I be using the git version?
You want to follow this guide1 for installing from pip. It covers both Postorius and Hyperkitty.
I am assuming you saw it in this doc 2 to use the example_project. That is very specific to development installations. I will update the document to make it clearer and point to 1 for any production setup.
-- Your life is like a penny. You're going to lose it. The question is: How do you spend it?
John Covici wb2una covici@ccs.covici.com
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/
Hi John,
On Mar 16, 2021, at 6:58 AM, John Covici <covici@ccs.covici.com> wrote:
Hi. I am trying to setup postorius, but I have run into a problem. I am using the example project, except I am using postgresql instead of sqlite3. I ran python manage.py migrate which was successful.
Are you trying to setup locally for development or are you setting up a production installation?
On running the development server I get: Exception in thread django-main-thread: Traceback (most recent call last): File "/usr/lib/python3.8/site-packages/django/utils/module_loading.py", line 20, in import_string return getattr(module, class_name) AttributeError: module 'postorius.middleware' has no attribute ‘APICountingMiddleware'
APICountingMiddleware is from a development branch of Postorius, so unless you are installing from git, this won’t be present since it hasn’t been released.
If you are actually doing development, you want to install from the Git source tree by running:
$ pip install -e .
You can skip the -e
if you want to install from git but not develop.
From the top level directory of Postorius (where setup.py is, one level above example_project).
If you are trying to setup a production installation, you want settings from https://mailman-web.readthedocs.io/en/latest/settings.html#mailman_web.setti...
This is for both Postorius and Hyperkitty.
thanks, Abhilash
participants (3)
-
Abhilash Raj
-
John Covici
-
Stephen J. Turnbull