Symptoms
- works well with native development server
- as soon as we switch to apache --> thumbnails stop getting generated
Issues:
- no log messages at usual places, /var/log/apache2/error.log
Findings:
- read sorl code + documentation
Documentation:
https://sorl-thumbnail.readthedocs.io/en/latest/examples.html#model-examples
http://sorl-thumbnail.readthedocs.io/en/latest/logging.html
Sorl code:
https://github.com/jazzband/sorl-thumbnail/search?utf8=%E2%9C%93&q=get_thumbnail&type=
-->
- Sorl default logger is email:
http://sorl-thumbnail.readthedocs.io/en/latest/logging.html
- converted the default email logger to file logger -->
- reading the logs found out that MEDIA_ROOT was not correctly set.
usually is os.path.join(DJANGO_ROOT,'media')
(was trying to use Apache default, DocumentRoot /var/www/ )
- and hence was running into permission issues.