agusmakmun / django-log-viewer

Django Log Viewer allows you to read & download log files in the admin page
https://pypi.org/project/django-log-viewer/
MIT License
74 stars 30 forks source link

Page Refresh gives the following error #39

Open magedhelmy1 opened 1 year ago

magedhelmy1 commented 1 year ago

Details

Steps to reproduce

  1. Go to /logs
  2. refresh page
ERROR 2023-04-21 22:10:28,947 django.request.log_response:241- Internal Server Error: /logs/json/
Traceback (most recent call last):
  File "/Users/magedhelmy/Library/Caches/pypoetry/virtualenvs/compute-local-ILDnfiEN-py3.10/lib/python3.10/site-packages/django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
  File "/Users/magedhelmy/Library/Caches/pypoetry/virtualenvs/compute-local-ILDnfiEN-py3.10/lib/python3.10/site-packages/django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/Users/magedhelmy/Library/Caches/pypoetry/virtualenvs/compute-local-ILDnfiEN-py3.10/lib/python3.10/site-packages/sentry_sdk/integrations/django/views.py", line 85, in sentry_wrapped_callback
    return callback(request, *args, **kwargs)
  File "/Users/magedhelmy/Library/Caches/pypoetry/virtualenvs/compute-local-ILDnfiEN-py3.10/lib/python3.10/site-packages/django/views/generic/base.py", line 104, in view
    return self.dispatch(request, *args, **kwargs)
  File "/Users/magedhelmy/Library/Caches/pypoetry/virtualenvs/compute-local-ILDnfiEN-py3.10/lib/python3.10/site-packages/django/utils/decorators.py", line 46, in _wrapper
    return bound_method(*args, **kwargs)
  File "/Users/magedhelmy/Library/Caches/pypoetry/virtualenvs/compute-local-ILDnfiEN-py3.10/lib/python3.10/site-packages/django/contrib/auth/decorators.py", line 23, in _wrapper_view
    return view_func(request, *args, **kwargs)
  File "/Users/magedhelmy/Library/Caches/pypoetry/virtualenvs/compute-local-ILDnfiEN-py3.10/lib/python3.10/site-packages/django/utils/decorators.py", line 46, in _wrapper
    return bound_method(*args, **kwargs)
  File "/Users/magedhelmy/Library/Caches/pypoetry/virtualenvs/compute-local-ILDnfiEN-py3.10/lib/python3.10/site-packages/django/contrib/auth/decorators.py", line 23, in _wrapper_view
    return view_func(request, *args, **kwargs)
  File "/Users/magedhelmy/Library/Caches/pypoetry/virtualenvs/compute-local-ILDnfiEN-py3.10/lib/python3.10/site-packages/log_viewer/views.py", line 23, in dispatch
    return super(TemplateView, self).dispatch(*args, **kwargs)
  File "/Users/magedhelmy/Library/Caches/pypoetry/virtualenvs/compute-local-ILDnfiEN-py3.10/lib/python3.10/site-packages/django/views/generic/base.py", line 143, in dispatch
    return handler(request, *args, **kwargs)
  File "/Users/magedhelmy/Library/Caches/pypoetry/virtualenvs/compute-local-ILDnfiEN-py3.10/lib/python3.10/site-packages/django/views/generic/base.py", line 227, in get
    return self.render_to_response(context)
  File "/Users/magedhelmy/Library/Caches/pypoetry/virtualenvs/compute-local-ILDnfiEN-py3.10/lib/python3.10/site-packages/log_viewer/views.py", line 106, in render_to_response
    log_json = self.get_log_json(context)
  File "/Users/magedhelmy/Library/Caches/pypoetry/virtualenvs/compute-local-ILDnfiEN-py3.10/lib/python3.10/site-packages/log_viewer/views.py", line 47, in get_log_json
    context["next_page_files"] = log_file_data["next_page_files"]
KeyError: 'next_page_files'