Re: pglister: bug: Can't add moderators (and create lists)

Поиск
Список
Период
Сортировка
От Célestin Matte
Тема Re: pglister: bug: Can't add moderators (and create lists)
Дата
Msg-id ebc45d80-4242-efc8-2951-05eae3a2d741@cmatte.me
обсуждение исходный текст
Ответ на Re: pglister: bug: Can't add moderators (and create lists)  (Magnus Hagander <magnus@hagander.net>)
Ответы Re: pglister: bug: Can't add moderators (and create lists)  (Magnus Hagander <magnus@hagander.net>)
Список pgsql-www
> 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

 
>> 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>

-- 
Célestin Matte



В списке pgsql-www по дате отправления:

Предыдущее
От: "REIX, Tony"
Дата:
Сообщение: RE: Add AIX on the PostgreSQL Download page
Следующее
От: "Jonathan S. Katz"
Дата:
Сообщение: Re: Add AIX on the PostgreSQL Download page