Re: pglister: bug: Can't add moderators (and create lists)
От | Magnus Hagander |
---|---|
Тема | Re: pglister: bug: Can't add moderators (and create lists) |
Дата | |
Msg-id | CABUevEzCd7jAdGskWOta1Tu-QbeFTaRUxo3fdTth0vuadPhsRQ@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: pglister: bug: Can't add moderators (and create lists) (Célestin Matte <celestin.matte@cmatte.me>) |
Список | pgsql-www |
On Tue, Sep 21, 2021 at 12:01 PM Célestin Matte <celestin.matte@cmatte.me> wrote: > > > For example, for my local pglister installation I have a mapping for > > static files of: > > /media/admin -> > > /home/mha/django/django22-py3/lib/python3.7/site-packages/django/contrib/admin/static/admin > > > > (this being in my virtualenv that holds the django installation) > > Oh, so these files are all shipped with django. Thanks, that solves the issue Yup. > >> Unrelated issue I encountered when debugging: when activating logging in django, the log file get spammed with exceptionsevery time django is hitting a {%if somevariable %} syntax, even though that's the correct django way to test variableexistence [1]. Any idea what could be causing that? > >> [1] https://docs.djangoproject.com/en/2.2/ref/templates/builtins/#if > > > > That's strange. I don't see any of that. Exactly what does the > > exception look like? > > > > Example on the main page, with a DEBUG-level logger activated: > Exception while resolving variable 'title' in template 'home.html'. > Traceback (most recent call last): > File "/srv/pglister/local/web/pglister/lib/python3.7/site-packages/django/template/base.py", line 829, in _resolve_lookup > current = current[bit] > File "/srv/pglister/local/web/pglister/lib/python3.7/site-packages/django/template/context.py", line 83, in __getitem__ > raise KeyError(key) > KeyError: 'title' > > During handling of the above exception, another exception occurred: > > Traceback (most recent call last): > File "/srv/pglister/local/web/pglister/lib/python3.7/site-packages/django/template/base.py", line 835, in _resolve_lookup > if isinstance(current, BaseContext) and getattr(type(current), bit): > AttributeError: type object 'RequestContext' has no attribute 'title' > > During handling of the above exception, another exception occurred: > > Traceback (most recent call last): > File "/srv/pglister/local/web/pglister/lib/python3.7/site-packages/django/template/base.py", line 843, in _resolve_lookup > current = current[int(bit)] > ValueError: invalid literal for int() with base 10: 'title' > > During handling of the above exception, another exception occurred: > > Traceback (most recent call last): > File "/srv/pglister/local/web/pglister/lib/python3.7/site-packages/django/template/base.py", line 850, in _resolve_lookup > (bit, current)) # missing attribute > django.template.base.VariableDoesNotExist: Failed lookup for key [title] in [{'True': True, 'False': False, 'None': None},{'csrf_token': <SimpleLazyObject: <function csrf.<locals>._get_val at 0x7fa5737bdea0>>, 'request': <WSGIRequest: GET'/'>, 'user': <SimpleLazyObject: <function AuthenticationMiddleware.process_request.<locals>.<lambda> at 0x7fa573832488>>,'perms': <django.contrib.auth.context_processors.PermWrapper object at 0x7fa5737fc518>, 'messages': <django.contrib.messages.storage.fallback.FallbackStorageobject at 0x7fa573800a58>, 'DEFAULT_MESSAGE_LEVELS': {'DEBUG': 10,'INFO': 20, 'SUCCESS': 25, 'WARNING': 30, 'ERROR': 40}}, {}, {'view': <pglister.lists.views.Home object at 0x7fa573800b70>}] > > > This line triggering this is in templates/base.html: > <title>{%if title%}{{title}} - {%endif%}PostgreSQL mailing lists</title> Huh, strange. I'm not seeing this on my local dev, and we're obviously also not seeing in production or nothing would work. These are both Debian environments though, python 3.7.3 and django 2.2.24. -- Magnus Hagander Me: https://www.hagander.net/ Work: https://www.redpill-linpro.com/
В списке pgsql-www по дате отправления: