Skip to content

Instantly share code, notes, and snippets.

@omarsumadi
omarsumadi / middleware.py
Created November 25, 2020 02:52 — forked from Schnouki/middleware.py
WhiteNoiseMiddleware that restrics access to sourcemaps to authorized users
import fnmatch
from django.conf import settings
from django.http import HttpResponseForbidden
from whitenoise.middleware import WhiteNoiseMiddleware
class AuthenticatedWhiteNoiseMiddleware(WhiteNoiseMiddleware):
def __init__(self, *args, **kwargs):