I'm deploying django project on heroku, it works fine, but in django admin, when i'm trying to upload image i got error:
OSError at /admin/blocks/block/add/
[Errno 30] Read-only file system: '/home/goldwedd'
I'm deploying django project on heroku, it works fine, but in django admin, when i'm trying to upload image i got error:
OSError at /admin/blocks/block/add/
[Errno 30] Read-only file system: '/home/goldwedd'
This is by design.
Your app is compiled into a slug for fast distribution by the dyno manager. The filesystem for the slug is read-only, which means you cannot dynamically write to the filesystem for semi-permanent storage. The following types of behaviors are not supported:
- Caching pages in the public directory
- Saving uploaded assets to local disk (e.g. with attachment_fu or paperclip)
- Writing full-text indexes with Ferret
- Writing to a filesystem database like SQLite or GDBM
- Accessing a git repo for an app like git-wiki
https://devcenter.heroku.com/articles/read-only-filesystem
If you want to upload files, you need to do so to S3 or any of the other storage backends supported by django-storages.
Yes, you can not upload media files at heroku. Only via git you can deploy things and if you deploy static or media files they will be available with some workarounds.
For live file upload you should consider to use an external service like Amazon S3. There is an excellent library for django to deal with it (its also suggested by the heroku dev site, as far as I remember): django-storages