How to set content type of JavaScript files in Django

后端 未结 4 941
野趣味
野趣味 2021-01-13 07:48

I have a Django application, which requires several JavaScript files.

In Chrome I get the error \"Resource interpreted as Script, but transferred with MIME type text

4条回答
  •  自闭症患者
    2021-01-13 08:30

    Since this doesn't prevent scripts from being interpreted correctly by the browser, why is this a problem? runserver is only for development (not production use), and as such is not a full blown web server.

    You should continue to use it in development and when you move to production configure your webserver appropriately for static files.

    However, if you absolutely must use the development server to serve static files; see how to serve static files.

提交回复
热议问题