django-rednoise
django-rednoise copied to clipboard
'DjangoRedNoise' object has no attribute 'mimetypes'
Just trying out rednoise. Encountered the following:
Django==1.8.2
django-rednoise==1.0.5
uWSGI==2.0.10
whitenoise==2.0
Traceback (most recent call last):
File "/path/to/python2.7/site-packages/rednoise/base.py", line 112, in __call__
asset = self.load_static_file(path)
File "/path/to/python2.7/site-packages/rednoise/base.py", line 232, in load_static_file
self.add_static_file(path)
File "/path/to/python2.7/site-packages/rednoise/base.py", line 196, in add_static_file
files[path] = self.get_static_file(file_path, path)
File "/path/to/python2.7/site-packages/whitenoise/base.py", line 200, in get_static_file
self.add_mime_headers(headers, path, url)
File "/path/to/python2.7/site-packages/whitenoise/base.py", line 214, in add_mime_headers
mimetype, encoding = self.mimetypes.guess_type(path)
AttributeError: 'DjangoRedNoise' object has no attribute 'mimetypes'
Yeah, that's likely due to the (pushed just today) 2.0 version of WhiteNoise. I've not yet had time to adjust RedNoise for it, but I pretty much already know where/what/how. Just a matter of getting to it.
Yep that was the issue. pip install "whitenoise<2" fixed the problem
@thenewguy Cool! I'd definitely love to hear your feedback; I've been using it so far with no issues but outside perspective is always welcome.
@ryanmcgrath I am only using it locally at the moment but it seems to solve the issues that originally kept me from using whitenoise. I like being able to easily use uwsgi for development over runserver.
Nice! Glad to hear it, that was my motivation as well - Whitenoise 2.0 includes some of this stuff now, but not quite all of it. I'll be updating it shortly to be compatible though.
Hi @ryanmcgrath, any update coming soon to make this work with WhiteNoise 2. I had to pip install "whitenoise<2" as well and make sure my requirements.txt had the v1 of whitenoise.
Hi, I've ran into the same issue. Using older version of WhiteNoise solved my problem and I'm waiting for new version of this package. Thanks.
I've been meaning to circle back to this recently, but it's worth noting: a lot of these changes were cloned into Whitenoise upstream. I'll update the repo at some point here, but a few months ago I spoke with the Whitenoise maintainer and... yeah. Does Rednoise even offer anything new for people at this point?
Any news here or plans to fix it?
@ryanmcgrath Yes, I think Red Noise still offers something that White Noise doesn't do. Most importantly (to me):
Not collecting a huge list of (potentially several thousand) static files one time at startup, but progressively adding to the cache as files are requested.
Is it possible to have a version of White Noise that just makes this change, and nothing else, so it's easier to keep up to date? White Noise 3.0 is about to land and Red Noise only works with 1.x
Hmmm, okay then - at this point I'd say I'll update it, but after Whitenoise 3.0 drops. I'm not familiar with the current state of the project, just because it's been a few months since I did a deep dive on it. If there's going to be any major changes or updates (which a 3.0 implies to me) I'd rather let those hit first.
Hey it's dropped: https://github.com/evansd/whitenoise/tree/v3.2.2
And this project would be really useful for some if you'd be interested in keeping it going: https://github.com/pydanny/cookiecutter-django/issues/869