localtime() cannot be applied to a naive datetime
Since yesterday I get the following error-message when I go to the webinterface:
ValueError at /admin/login/ localtime() cannot be applied to a naive datetime Request Method: GET Request URL: https://mailman.pgtrynwalden.nl/mailman3/admin/login/?next=/mailman3/admin/ Django Version: 2.2.28 Exception Type: ValueError Exception Value: localtime() cannot be applied to a naive datetime Exception Location: /usr/lib/python3/dist-packages/django/utils/timezone.py in localtime, line 207 Python Executable: /usr/bin/uwsgi-core Python Version: 3.9.2 Python Path: ['.', '', '/usr/lib/python39.zip', '/usr/lib/python3.9', '/usr/lib/python3.9/lib-dynload', '/usr/local/lib/python3.9/dist-packages', '/usr/lib/python3/dist-packages', '/usr/lib/python3.9/dist-packages'] Server time: vr, 1 Mrt 2024 11:52:50 +0100
Mailman info:
mailman info GNU Mailman 3.3.3 (Tom Sawyer) Python 3.9.2 (default, Feb 28 2021, 17:03:44) [GCC 10.2.1 20210110] config file: /etc/mailman3/mailman.cfg db url: mysql+pymysql://mailman3:xxxxxxx
If this issue was posted before, i'm sorry, i haven't found it:
Any ideas how to solve this issue would be appreciated
Environment:
Request Method: GET Request URL: https://mailman.pgtrynwalden.nl/mailman3/admin/login/?next=/mailman3/admin/
Django Version: 2.2.28 Python Version: 3.9.2 Installed Applications: ('hyperkitty', 'postorius', 'django_mailman3', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', 'rest_framework', 'django_gravatar', 'compressor', 'haystack', 'django_extensions', 'django_q', 'allauth', 'allauth.account', 'allauth.socialaccount', 'django_mailman3.lib.auth.fedora') Installed Middleware: ('django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.middleware.locale.LocaleMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'django.middleware.security.SecurityMiddleware', 'django_mailman3.middleware.TimezoneMiddleware', 'postorius.middleware.PostoriusMiddleware')
Traceback:
File "/usr/lib/python3/dist-packages/django/core/handlers/exception.py" in inner 35. response = get_response(request)
File "/usr/lib/python3/dist-packages/django/core/handlers/base.py" in _get_response 145. response = self.process_exception_by_middleware(e, request)
File "/usr/lib/python3/dist-packages/django/core/handlers/base.py" in _get_response 143. response = response.render()
File "/usr/lib/python3/dist-packages/django/template/response.py" in render 106. self.content = self.rendered_content
File "/usr/lib/python3/dist-packages/django/template/response.py" in rendered_content 83. content = template.render(context, self._request)
File "/usr/lib/python3/dist-packages/django/template/backends/django.py" in render 61. return self.template.render(context)
File "/usr/lib/python3/dist-packages/django/template/base.py" in render 169. with context.bind_template(self):
File "/usr/lib/python3.9/contextlib.py" in __enter__ 117. return next(self.gen)
File "/usr/lib/python3/dist-packages/django/template/context.py" in bind_template 246. updates.update(processor(self.request))
File "/usr/lib/python3/dist-packages/postorius/context_processors.py" in postorius 38. mailman_day=(timezone.localtime(timezone.now()).day == MAILMAN_DAY),
File "/usr/lib/python3/dist-packages/django/utils/timezone.py" in localtime 207. raise ValueError("localtime() cannot be applied to a naive datetime")
Exception Type: ValueError at /admin/login/ Exception Value: localtime() cannot be applied to a naive datetime
On 3/1/24 3:09 AM, Freerk Bosscha via Mailman-users wrote:
Since yesterday I get the following error-message when I go to the webinterface:
And what in your installation changed since yesterday?
ValueError at /admin/login/ localtime() cannot be applied to a naive datetime Request Method: GET Request URL: https://mailman.pgtrynwalden.nl/mailman3/admin/login/?next=/mailman3/admin/ Django Version: 2.2.28
This Django version is quite old.
... mailman info GNU Mailman 3.3.3 (Tom Sawyer)
and so is this Mailman version.
Do you have
USE_TZ = True
and a setting for TIME_ZONE
in your Django settings?
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
thanks for your reply, and sorry I did not replied before.
As far as I know, nothing changed. In fact, after a restart the system worked again...
I use the debian-version of it installed with apt install mailman3-full mailman3-web
The settings you mentioned are set.
But for now, case closed.
participants (2)
-
Freerk Bosscha
-
Mark Sapiro