django image storage cdn

心不动则不痛 提交于 2019-12-11 06:34:45

问题


I have been using rackspace CDN for the last few months with django-imagekit and django-cumulus.

And I am not really happy with the results.

I seem to get load of errors because of timeouts etc.

 File "/www/django_test1/omu2/src/python-cloudfiles/cloudfiles/connection.py", line 347, in get_container
   return Container(self, container_name, count, size)

 File "/www/django_test1/omu2/src/python-cloudfiles/cloudfiles/container.py", line 83, in __init__
   self._fetch_cdn_data()

 File "/www/django_test1/omu2/src/python-cloudfiles/cloudfiles/utils.py", line 43, in decorator
   return f(*args, **kwargs)

 File "/www/django_test1/omu2/src/python-cloudfiles/cloudfiles/container.py", line 90, in _fetch_cdn_data
   response = self.conn.cdn_request('HEAD', [self.name])

 File "/www/django_test1/omu2/src/python-cloudfiles/cloudfiles/connection.py", line 151, in cdn_request
   self.cdn_connection.request(method, path, data, headers)

 File "/opt/python2.6/lib/python2.6/httplib.py", line 898, in request
   self._send_request(method, url, body, headers)

 File "/opt/python2.6/lib/python2.6/httplib.py", line 915, in _send_request
   self.putrequest(method, url, **skips)

 File "/opt/python2.6/lib/python2.6/httplib.py", line 802, in putrequest
   raise CannotSendRequest()

CannotSendRequest

What can you guys recommend? S3?


回答1:


amazon cloudfront has been great for serving video for us. Check it here: http://aws.amazon.com/cloudfront/

You can use the boto package to integrate with it.

Check another example here: http://www.peterbe.com/plog/hosting-django-static-images-with-amazon-cloudfront-cdn



来源:https://stackoverflow.com/questions/3866635/django-image-storage-cdn

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!