Javascript 提供JS文件时出现Django dj静态错误
我明白了。有什么想法吗?仅在JavaScript文件中发生。版本:dj static==0.0.5,static==1.0.2,django pipeline==1.3.16,django=1.6.1。我知道答案不多,但去掉dj static对我来说就行了。如果您使用管道作为管道来编译静态文件并将其放置在可以提供服务的位置,那么您确实不需要它,只要您包含以下行:Javascript 提供JS文件时出现Django dj静态错误,javascript,python,django,django-staticfiles,Javascript,Python,Django,Django Staticfiles,我明白了。有什么想法吗?仅在JavaScript文件中发生。版本:dj static==0.0.5,static==1.0.2,django pipeline==1.3.16,django=1.6.1。我知道答案不多,但去掉dj static对我来说就行了。如果您使用管道作为管道来编译静态文件并将其放置在可以提供服务的位置,那么您确实不需要它,只要您包含以下行: (r'^static/(?p.*)$,'django.views.static.service',{'document_root:se
(r'^static/(?p.*)$,'django.views.static.service',{'document_root:settings.static_root})
在URL.py中的问题是较旧版本的django管道
使用mimetypes
输入unicode字符串(而不是字节字符串)发送消息。更新到1.3.22版解决了这个问题。同样,了解到dj static的github问题,升级到django pipeline的1.3.21版可以解决这个问题,但是没有diceI更新到1.3.22版,它现在正在工作。
2014-02-08T00:17:59.628381+00:00 app[web.1]: Traceback (most recent call last):
2014-02-08T00:17:59.628381+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/wsgiref/handlers.py", line 85, in run
2014-02-08T00:17:59.628381+00:00 app[web.1]: self.result = application(self.environ, self.start_response)
2014-02-08T00:17:59.628381+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/dj_static.py", line 64, in __call__
2014-02-08T00:17:59.628381+00:00 app[web.1]: return self.cling(environ, start_response)
2014-02-08T00:17:59.628381+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/static/apps.py", line 118, in __call__
2014-02-08T00:17:59.628381+00:00 app[web.1]: start_response("200 OK", headers)
2014-02-08T00:17:59.628381+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/wsgiref/handlers.py", line 180, in start_response
2014-02-08T00:17:59.628381+00:00 app[web.1]: assert type(val) is StringType,"Header values must be strings"
2014-02-08T00:17:59.628381+00:00 app[web.1]: AssertionError: Header values must be strings