'DjangoRedNoise' object has no attribute 'mimetypes' #1

Open
opened 2015-06-20 10:14:35 -07:00 by thenewguy · 12 comments
thenewguy commented 2015-06-20 10:14:35 -07:00 (Migrated from github.com)

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'
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' ```
ryanmcgrath commented 2015-06-20 10:16:03 -07:00 (Migrated from github.com)

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.

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.
thenewguy commented 2015-06-20 10:16:44 -07:00 (Migrated from github.com)

Yep that was the issue. pip install "whitenoise<2" fixed the problem

Yep that was the issue. pip install "whitenoise<2" fixed the problem
ryanmcgrath commented 2015-06-20 10:33:17 -07:00 (Migrated from github.com)

@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.

@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.
thenewguy commented 2015-06-23 14:38:54 -07:00 (Migrated from github.com)

@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.

@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.
ryanmcgrath commented 2015-06-23 23:05:38 -07:00 (Migrated from github.com)

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.

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.
jerrybroughton commented 2015-09-28 10:48:48 -07:00 (Migrated from github.com)

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 @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.
nournia commented 2015-12-24 07:21:43 -08:00 (Migrated from github.com)

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.

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.
ryanmcgrath commented 2016-01-05 15:13:53 -08:00 (Migrated from github.com)

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?

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?
schacki commented 2016-03-12 11:09:43 -08:00 (Migrated from github.com)

Any news here or plans to fix it?

Any news here or plans to fix it?
mrmachine commented 2016-03-21 23:26:27 -07:00 (Migrated from github.com)

@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

@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
ryanmcgrath commented 2016-03-22 01:36:57 -07:00 (Migrated from github.com)

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.

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.
spool commented 2016-12-05 04:33:06 -08:00 (Migrated from github.com)

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

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
This repository is archived. You cannot comment on issues.
No milestone
No project
No assignees
1 participant
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: code/django-rednoise#1
No description provided.