The reason is 'sorl.thumbnail' cannot find the image file.
The default behaviour of 'sorl.thumbnail' is to fail silently and return an empty string.
To change this I added 'THUMBNAIL_DEBUG = True' to my local_settings.py (see http://thumbnail.sorl.net/docs/#debugging-the-thumbnail-tag).
My first approach was to move all files in 'cms_project/site_media/media/gblocks/' to 'cms_project/site_media/gblocks/'.
But I think it is more effective to modify the settings.py:
- MEDIA_ROOT = os.path.join(PROJECT_ROOT, 'site_media', 'media')
+ MEDIA_ROOT = os.path.join(PROJECT_ROOT, 'site_media')
By the way 'cms_project_holidayhouse' has the same problem.
There is a reason it's $PROJECT_ROOT/site_media/media.
Static content is of two sorts: images, videos, etc. uploaded by users for example. This goes to $PROJECT_ROOT/site_media/media
Then there are CSS, javascript, etc. which is stuff that makes up a project. Those things live in $PROJECT_ROOT/site_media/static
Take a look at http://pypi.python.org/pypi/django-staticfiles to for more information on the matter.
Point is, changing MEDIA_ROOT as you supposed isn't the right thing to do. I didn't look at the code but it's probably the view that needs to be fixed.
Thank you for your reply.
I completely support the concept of separating static and user uploaded files.
When new files are uploaded they are stored by django-frontendadmin in $MEDIA_ROOT.
I think 'cms_project_holidayhouse' was created first and 'cms_project_company' is a slightly modified verion of it.
There is no '$PROJECT_ROOT/site_media/media' in 'cms_project_holidayhouse'.
Furthermore I am convinced the MEDIA_ROOT was changed after the example data was created without moving it.
That is why I think both ways are proper solutions to the problem. A decision is necessary in which way the static and non-static files should be separated in future.
Hi ralf!
The decision has already been made. As I said, *static contents is of two sorts* i.e. using django-staticfiles
1)
user-generated static content goes to MEDIA_ROOT
2)
project/app specific static content goes to STATIC_ROOT and STATICFILES_DIRS respectively
For cms_project_holidayhouse and cms_project_company that means they need to work apropriately, adhering 1 and 2 from above.
It appears the images are in the wrong directory and need to be moved from the $PINAX_ROOT/projects/cms_project_company/site_media/gblocks/ directory to the $PINAX_ROOT/projects/cms_project_company/site_media/media/gblocks/ directory.
I've tested this and it appears to solve the problem and put the images in the correct static contents directory.