Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

django-browser-reload is incompatible with the GZip middleware #204

Open
ghost opened this issue Sep 8, 2023 · 1 comment
Open

django-browser-reload is incompatible with the GZip middleware #204

ghost opened this issue Sep 8, 2023 · 1 comment

Comments

@ghost
Copy link

ghost commented Sep 8, 2023

Description

Folks thanks for maintaining this package. It recently stopped working for a project of mine and I bisected back to it starting to use the DjangoGZip middleware.

The symptom is that the reloads stop happening. Potential solution to #68 (comment).

I solved it by not using the GZip middleware at dev time, but perhaps this is a matter of ordering the middleware differently?

A suggestion for guarding against this, if you deem it useful: django-browser-reload should inspect the middleware list and crash the development server on start with a helpful message if the gzip middleware is present (at the wrong place in the list?), unless ALLOW_BROKEN_GZIP_RELOAD=True.

Cheers.

@adamchainz
Copy link
Owner

adamchainz commented Sep 8, 2023

Yes it’s an ordering issue. See step 5 of the instructions: https://github.com/adamchainz/django-browser-reload#installation

We could add a system check but it would have to be specific to GZipMiddleware and would miss other encoding middleware from third party packages. Maybe that’s okay. No need for a custom setting to silence it if we create a system check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant