How to set content type of JavaScript files in Django

后端 未结 4 965
野趣味
野趣味 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:19

    For Django use request context in views :

    return render_to_response('success.html', {'object': varobject},context_instance=RequestContext(request))
    

提交回复
热议问题