Unintended GET Request Occurs After Page Display

Asked 2 years ago, Updated 2 years ago, 70 views

Hi, everyone.I recently started studying Python and Django.
I would like to ask you about the cause of the unintended GET request after the page is displayed.

Event

When viewing the top page of the web application being created, the screen itself is displayed without any problems (GET200), but the terminal will experience unintended URL access and 404 errors as follows:
Data retrieved from DB is also displayed as intended.
I would appreciate it if you could tell me how to investigate the cause of the request to /null.

[27/May/2022 10:01:39] "GET/HTTP/1.1" 2002515 Not Found:/null
[27/May/2022 10:01:39] "GET/null HTTP/1.1" 404 2622

Tried

We have isolated that the following is not the cause.

  • templates:
    I was expanding the template, and I tried to leave the html content blank for each of the two templates that make up the target screen, but it didn't work.
  • class-based view, function view:
    I'm currently using class-based view, but it didn't work when I changed it to function-based view.

Source

Share the relevant views.py, urls.py.

urls.py

 urlpatterns=[
    path(', views.Dashboard.as_view(), name='dashboard'),
]

views.py

class Dashboard (View, LoginRequiredMixin):
    default(self, request):
        study_records=StudyRecord.objects.filter(recorder=request.user).order_by('-created_date')[:DASHBOARD_RECORD_DISPLAY]
        return render(request, 'mystudy/dashboard.html', {'study_records':study_records})

Python 3.10.4
Django 4.0.4

python django

2022-09-29 21:49

1 Answers

In my case, the mouse gesture tool "crxMouse Chrome™ Gestures" with Chrome extensions was the cause.
This extension inserts style="cursor:url("null"), default;" into the <body of the html, so an error is displayed.


2022-09-29 21:49

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.