Why django staticfiles serving svg as application/

2019-06-26 08:15发布

I used wagtail-generator with yoeman to generate a wagtail django project and svg files served by django with django.contrib.staticfiles output application/octet-stream mimetype instead of image/svg+xml mimetype which breaks picture rendering.

I tried this solution without success but I'm sure that using something like nginx to serve static files would fix this (did not try yet).

Based on this answer to another of my questions, I can copy wagtail's template in my templates so I can change the admin logo, but it doesn't fix the svg problem ;)

What I'm getting right now:

wagtail with broken svg logo

And here's the response from Chrome network tab in case it could help:

Chrome network tab

$ wget http://localhost:8000/static/wagtailadmin/images/wagtail-logo.svg

output:

--2014-07-02 16:14:36--  http://localhost:8000/static/wagtailadmin/images/wagtail-logo.svg
Resolving localhost... 127.0.0.1, ::1, fe80::1
Connecting to localhost|127.0.0.1|:8000... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3082 (3.0K) [application/octet-stream]
Saving to: 'wagtail-logo.svg'

100%[=============================================================>] 3,082       --.-K/s   in 0.006s

2014-07-02 16:14:36 (466 KB/s) - 'wagtail-logo.svg' saved [3082/3082]

0条回答
登录 后发表回答