Both my admin and site pages do not display thumbnails of my images correctly:
My project is completely borrowed from the following photologue tutorial: https://github.com/jdriscoll/django-photologue/tree/master/example_project
I am using Django 1.6.2 and Photologue 2.7. All requirements were installed according to the tutorial.
I made absolutely no changes to the tutorial source code, successfully added a gallery and photos (from admin page) to the database and successfully did a synchdb
, migrate
, and plinit
command.
My "cache" directory is empty however, as if the thumbnails simply aren't being generated even though I manually force pre-cache images to be cached using plcache
command taken from the docs: https://code.google.com/p/django-photologue/wiki/ManagementCommands
And, all of my images are pre-cache so I'm really not sure why they aren't getting cached...:
The debugger in eclipse pydev tells me it is attempting to locate the thumbnails, but like I mentioned before they are not being cached so it prints:
[08/Mar/2014 16:51:42] "GET /media/photologue/photos/cache/pic3_thumbnail.jpg HTTP/1.1" 404 1780
According to this post this error might be caused by an incorrect MEDIA_URL or MEDIA_ROOT setting: sorl-thumbnail not creating thumbnails
However, my media root and url were set by the tutorial I'm borrowing from which I assume to be set correctly.
This problem is identical to the one reported on this google group forum: https://groups.google.com/forum/#!topic/django-photologue/tu4IVekLJJo
Has anyone had a similar issue to this before? How might I get the thumbnails to cache and be displayed?
As hinted at in a few of the links I referenced, Pillow was the culprit. I installed 2.2.1 using pip install Pillow
and although the install finished successfully, a simple test failed such as: from PIL import Image
Upon viewing this post: Installing Pillow for Python on Windows
I went ahead and used the executable installer: http://www.lfd.uci.edu/~gohlke/pythonlibs/#pillow
I was able to successfully perform the above test.
With Pillow successfully installed and tested, the cache management command, plcache
, finally worked, the "cache" folder was filled, and the thumbnails are now shown in my site!