0

I have a python app built on oTree software which I am trying to upload onto and deploy from Heroku. However, I keep getting an error that my slug size is too big. It is around 40 M more that the 500 M that Heroku allows.

I have added a .gitignore. I have reset the repo with heroku repo:reset -a appname. I have looked online and this is what is mostly recommended in this case.

I was wondering what causes a large slug size. My app has a lot of media files (audio, video, image) that need to be uploaded. Can that cause the slug size to be too big? Even so the total size of the file of the app is less than 300 M.

I would appreciate any help. Thank you!

Kavan Tej
  • 1
  • 1

1 Answers1

1

The slug size is not just your Python script. It's all the files in your GIT repository. So yes, having a lot of media files will increase your slug size and is probably the cause for your issue here.

Have you considered uploading those files to a provider such as S3? That way, they wouldn't count as part of your slug, and you could add new ones just by uploading them to S3, without needing to redeploy your Heroku app.

Damien MATHIEU
  • 31,924
  • 13
  • 86
  • 94
  • Thanks for you reply! I am currently trying to use Cloudinary for this purpose. However, does this mean I have to go into my code and change the "src" for all my media files if I upload them to a place like S3 or Cloudinary? Also, is S3 paid? – Kavan Tej Jul 25 '18 at 09:00