[GH-ISSUE #788] Use whitenoise for serving static files instead of django.views.static.serve #2010

Closed
opened 2026-03-01 17:55:47 +03:00 by kerem · 1 comment
Owner

Originally created by @pirate on GitHub (Jul 14, 2021).
Original GitHub issue: https://github.com/ArchiveBox/ArchiveBox/issues/788

https://github.com/evansd/whitenoise

With a couple of lines of config WhiteNoise allows your web app to serve its own static files, making it a self-contained unit that can be deployed anywhere without relying on nginx, Amazon S3 or any other external service. (Especially useful on Heroku, OpenShift and other PaaS providers.)

MIDDLEWARE = [
  # 'django.middleware.security.SecurityMiddleware',
  'whitenoise.middleware.WhiteNoiseMiddleware',
  # ...
]

STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'

Also has the added benefit of supporting Byte-Range requests (so video files will be seekable), brotli/gzip compression, and other nice headers

Originally created by @pirate on GitHub (Jul 14, 2021). Original GitHub issue: https://github.com/ArchiveBox/ArchiveBox/issues/788 https://github.com/evansd/whitenoise > With a couple of lines of config WhiteNoise allows your web app to serve its own static files, making it a self-contained unit that can be deployed anywhere without relying on nginx, Amazon S3 or any other external service. (Especially useful on Heroku, OpenShift and other PaaS providers.) ```python3 MIDDLEWARE = [ # 'django.middleware.security.SecurityMiddleware', 'whitenoise.middleware.WhiteNoiseMiddleware', # ... ] STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage' ``` Also has the added benefit of supporting Byte-Range requests (so video files will be seekable), brotli/gzip compression, and other nice headers
Author
Owner

@pirate commented on GitHub (Jan 19, 2024):

I tried this and it doesn't actually help us with anything, since we need byte-range requests for user-created archive content, not the staticfiles.

Removed it in favor of configuring uwsgi to support honor byte-range requests instead.

<!-- gh-comment-id:1899618415 --> @pirate commented on GitHub (Jan 19, 2024): I tried this and it doesn't actually help us with anything, since we need byte-range requests for user-created archive content, not the staticfiles. Removed it in favor of configuring uwsgi to support honor byte-range requests instead.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ArchiveBox#2010
No description provided.