Opened 11 years ago
Closed 11 years ago
#22754 closed Uncategorized (wontfix)
Consider Making runserver Serve Correct M4A MIME Type for Internet Explorer
Reported by: | nrogers64 | Owned by: | nobody |
---|---|---|---|
Component: | Uncategorized | Version: | 1.6 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
I understand that the Django Software Foundation is "in the business of making Web frameworks, not Web servers", so runserver is meant to be a quick and dirty web server and nothing more. However, I was recently working on a project where I was making a lot of changes to Python code for a view that would render a template that had M4A audio files. In order for this page to work in Internet Explorer, I had to use a proper web server, which meant that every time I changed Python code, I had to restart the web server. It would have been nice if runserver played well with Internet Explorer because it would have sped up the development process. In case you don't know what I'm talking about:
Beginning with Internet Explorer 9, any audio or video content needs the correct mime type set on the server, or the files won't play.
Source: http://msdn.microsoft.com/en-us/library/hh924821%28v=vs.85%29.aspx#SERVEAUDIOANDVIDEO
I imagine this would be an easy thing to add. It's just making it so that files with the "m4a" extension get served with a MIME type of "audio/mp4". However, I understand that you might not want to make even a little improvement to runserver because then somebody else will request another change to it, and then another, and so on until you find yourself putting too much effort into runserver.
Change History (2)
comment:1 by , 11 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 11 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
The dev server already guesses mimetypes. An appropriate call to mimetypes.add_type at the application level should be enough to fix this particular requirement.
I don't want to hardcode special cases in Django, because as soon as we diverge from the stdlib, we carry the maintenance burden.
If this required a large complex change, then I'd say it isn't worth it, but in this case, it should be relatively simple. Python has a mimetype module that can be used to identify the mimetype of content based on a filename; we just need to provide that information in the staticfiles server.