5👍
Changed MEDIA_ROOT
path by removing additional os.path.dirname()
and it is working now.
MEDIA_ROOT = os.path.join(BASE_DIR, 'static_cdn', 'media_root')
6👍
In my case, this error occurred because I set the STATIC_ROOT = '/static/'
This means it’s looking at /
root folder of the system and then static
, which is obviously read-only,
changing it to STATIC_ROOT = 'static/'
fixed my issue.
1👍
I’m using
gTTS
to convert text to speech and save.mp3
file in the media directory
I’m not sure what’s causing your immediate error, but this isn’t going to work very well on Heroku. Its filesystem is ephemeral: you can write to it, but whatever you write will be lost when the dyno restarts. This happens frequently (at least once per day).
Heroku recommends using a third-party file or object store like Amazon S3 for storing generated files, uploaded files, etc. I recommend gong down this path. There are many Django libraries for using S3, and other services, as storage backends.
- [Django]-Successful Django Deploy Through AWS Elastic Beanstalk, But Getting 500 ERROR
- [Django]-Django – how to restrict DeleteView to object owner
- [Django]-Social media link in Django
- [Django]-Save user with generated password with Django
- [Django]-Django Template: Comparing Dictionary Length in IF Statement