Django Media on Heroku, Boto or Cloudinary

I am developing a Django CMS project for a client that uses the Aldryn blog via apphook. I'm trying to deploy to Heroka. Due to the Heroku ephemeral file system, media must be hosted outside. Currently, the only environment consists of Django CMS Picture plugins (which use the standard ImageField) and Aldryn blog entries (which use FilerImageField and easy_thumbnails).

I read about using Boto to store on S3, which seems to be as simple as setting a new DEFAULT_FILE_STORAGE (and THUMBNAIL_DEFAULT_STORAGE). This seems like a great solution, but everything else (web server, search engine, database) is provided by Heroku and its add-ons. When a customer signs up, I would just transfer the ownership of Heroku.

This led me to consider using Cloudinary as a Heroku add-on, but I got confused about integration. Instead of just changing DEFAULT_FILE_STORAGE, would I have to change ImageFields and FileImageFields to CloudinaryFields and lose (or be forced to somehow patch the monkey) in Filer and easy_thumbnail?

It seems that I either choose Boto and the client credit card is sent to both Heroku and S3, or I choose Cloudinary and do some rough integration. Is there a better solution?

+4
source share
1 answer

You do not necessarily have the best solution. The problem with Heroku is that if you want to download something larger than a few mb - or, more importantly, you want to do it through a potentially slow connection - you will press hard timeouts because Django works by first accepting your file how it was published on the form and then uploaded it - via the Heroku dinar - to the cloud storage provider.

AWS, S3 CloudFront, s3direct. , ImageField FileField S3DirectField s, URL- ( S3, CloudFront). AJAX . , "" .

, , . - - S3Direct , , , , settings.py, .

Django CMS, , .

, .

+2

Source: https://habr.com/ru/post/1547613/


All Articles