Remove Nginx-specific static and media serving, and serve media through Django using WhiteNoise and FileResponse.

This commit is contained in:
krek0 2026-04-24 22:26:03 +02:00
parent aa348d2b04
commit 92e1336f80
6 changed files with 46 additions and 23 deletions

12
photo21/storage.py Normal file
View file

@ -0,0 +1,12 @@
from whitenoise.storage import CompressedManifestStaticFilesStorage
class CompressedManifestStorage(CompressedManifestStaticFilesStorage):
"""Like CompressedManifestStaticFilesStorage but silently skips missing
referenced files (e.g. source maps not included in the package)."""
def hashed_name(self, name, content=None, filename=None):
try:
return super().hashed_name(name, content, filename)
except ValueError:
return name