adamchainz / django-browser-reload

Automatically reload your browser in development.
MIT License
516 stars 26 forks source link

Not Implemented /events 501 error #227

Closed Kyvex closed 9 months ago

Kyvex commented 11 months ago

Python Version

3.11.0

Django Version

4.1.2

Package Version

1.12.1

Browser

Google

Description

When running my server I get this repeating message. Any ideas? Screenshot 2023-11-28 at 6 07 41 PM

adamchainz commented 11 months ago

I’m not sure. django-browser-reload won't send a 501. It may be sent by a wrapper like a middleware.

If you can capture the response in your browser’s devtools, that should give more information. You will need to debug the web worker.

Kyvex commented 11 months ago

What's weird is that no workers are showing in my console. This is all that is shown.

Screenshot 2023-11-29 at 9 26 14 AM
GopyDev commented 9 months ago

I'm getting same error. I'm using Daphne and running app like this

daphne projectname.asgi:application

but when running it, showing error like this image

Here is what I can see on browser console as an error. image

Any ideas about this error?

adamchainz commented 9 months ago

Ah okay, so you’re using Daphne, so aync. Now I remember that async mode requires Django 4.2+. We decided to make django-browser-reload return “501 Not Implemented” on older Django versions:

https://github.com/adamchainz/django-browser-reload/blob/97754e2382b1a28df56332eabce58781f4c953de/src/django_browser_reload/views.py#L158-L164

So the solution here is to upgrade Django. Perhaps this could be better documented?