Remove Nginx-specific static and media serving, and serve media through Django using WhiteNoise and FileResponse.
This commit is contained in:
parent
aa348d2b04
commit
92e1336f80
6 changed files with 46 additions and 23 deletions
12
photo21/storage.py
Normal file
12
photo21/storage.py
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue