django-mfa3 icon indicating copy to clipboard operation
django-mfa3 copied to clipboard

add STATIC_URL in middleware exclude

Open lsaavedr opened this issue 1 year ago • 3 comments

Hi,

with this PR can be importing css or other stuff from static files,

regards!

lsaavedr avatar Jul 30 '24 21:07 lsaavedr

I don't see why this should be necessary. In production you usually don't serve static files from django, so the request doesn't go through the middleware. In development you usually use the staticfiles app, which doesn't go through middleware either.

Am I missing something? Can you provide a reproducable case in which this makes a difference?

xi avatar Jul 31 '24 07:07 xi

this is necessary to develop with any ASGI server like uvicorn or daphne that serve static files through middleware, I think that others developers also work in development with ASGI servers to manage async viewers or channels

lsaavedr avatar Jul 31 '24 12:07 lsaavedr

Can you provide more details on your setup? The official documentation does not mention anything special about static files. Any tutorials I found (e.g. this one also recommended to bypass django when serving static files. So I tend to believe that this is an issue with your setup rather than django-mfa3.

xi avatar Jul 31 '24 17:07 xi