2014-02-08 26 views
0
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 

我收到了。有任何想法嗎?只發生在JavaScript文件中。版本:dj-static == 0.0.5,static == 1.0.2和django-pipeline == 1.3.16,Django = 1.6.1。Django dj服務JS文件時出現的靜態錯誤

+1

也得到這個,在dj靜態的github問題中讀到,升級到django-pipeline的1.3.21可以解決這個問題,但沒有骰子 – Bobby

+0

我更新到1.3.22,它現在正在工作。 –

回答

0

問題是django-pipeline的舊版本與mimetypes消息輸入unicode字符串(不是字節字符串)。更新到版本1.3.22修復了這個問題。

0

沒有太多的答案,我知道,但拿出dj-static爲我做了。你真的不需要它,如果你使用管道無論如何作爲管道負責編譯你的靜態文件,並把它們放在一個地方,只要你包含這條線:

(r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.STATIC_ROOT})在你的urls.py