Selecting whitenoise still requires AWS setup
See original GitHub issueI had selected whitenoise from the django cookiecutter configuration, but when it comes to deploying on heroku I get an improperly configured error if eg DJANGO_AWS_ACCESS_KEY_ID
isn’t set (same with the other AWS envs). The settings file also outputs the comment at the top: `Use Amazon’s S3 for storing static files and uploaded media’ even though the whitenoise middleware looks to be properly setup.
Issue Analytics
- State:
- Created 7 years ago
- Comments:20 (7 by maintainers)
Top Results From Across the Web
Selecting whitenoise still requires AWS setup #869 - GitHub
It seems like a halfway house of whitenoise and AWS set up by default, and I'm now trying to get away from AWS...
Read more >Using WhiteNoise with Django
Restricting CloudFront to static files# · Go to your newly created distribution and click “Distribution Settings”, then the “Behaviors” tab, then “Create ...
Read more >'collectstatic' command fails when WhiteNoise is enabled
The problem here is that css/iconic/open-iconic-bootstrap.css is referencing a file, open-iconic.eot , which doesn't exist in the expected location.
Read more >Serving Static Files from Flask with WhiteNoise and Amazon ...
To set up, log in to the AWS Console and navigate to the CloudFront dashboard. Click "Create Distribution" and choose "Get Started" under...
Read more >Static Files Made Easy — Django Compressor + Whitenoise + ...
Tutorials galore on how to set up Django with AWS S3 or Whitenoise, but rarely can one find detailed guides on configuring Whitenoise, ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Whitenoise is working pretty well in the current configuration on multiple platforms. If we are going to remove it, we have to find another library that supports all of them, too.
From my POV, this is a documentation problem:
That makes total sense, because static and media files both have different requirements. Static files can be generated from scratch for each deployment, media files OTOH are ideally stored in a central place with proper backups (S3).
For certain deployments, it might make sense to add an option to let whitenoise also handle the media files.
@pydanny. Thanks for the input. I think the assumption here is that all sites need to serve media files, where for a lot, they don’t so a simplified Whitenoise (plus CDN) does have value.
The original question was assuming no media files were required and was never about whitenoise being used to serve media files (that really doesn’t seem to be it’s intended use case) . sorry if this wasn’t clear.
The default setup when choosing whitenoise almost works with this, it just needs a
WHITENOISE_MAX_AGE
to be set to work with with a CDN. (All the AWS settings are then redundant if not using S3 for static files).So perhaps cookiecutter should have a ‘use_whitenoise’ y/n and a ‘use_aws_for_media’ y/n question where if whitenoise is selected all awss option to do with static file serving are dropped eg
AWS_EXPIRY
and if ‘use_aws_for_media’ is n then the rest of the settings are dropped.I don’t mind if you wish to get the cookiecutter config options down to have this in the docs.
Happy to make the changes needed as so far with django-cookiecutter I’ve done,
(Probably should have ditched whitenoise in the last case, but it evolved to that overtime. )