So I have been looking up and down for a good solution to display images, audio, media in general with django:
From what I found there is the following solutions:
1. Photologue:
Cant seem to make it work. It needs PIL and libjepg.
I tried to install both, but ran into different build problems.
Someone on stackoverflow recommended me this link:
http://appelfreelance.com/2010/06/libjpeg-pil-snow-leopard-python2-6-_jpeg_resync_to_restart/
Which is a great tutorial and also deals with removing PIL and reinstalling (which I have to do, I guess). But somewhere along this tutorial I have to do this:
sudo rm -Rf build
And I dont feel confident enough to run a sudo rm command.
Also I thought there must be an easier way to achieve this, since EVERY Blog needs to display media.
2. Django itself says:
Let Apache do the display and use this:
(r'^site_media/(?P<path>.*)$', 'django.views.static.serve',
{'document_root': '/pathtomedia/', 'show_indexes': True}),
for development BUT not for production.
So what does everybody use for production?
3. Other:
I managed to display images via os.listdir , urllist and a template:
allimg= os.listdir("/pathtomyimages/")
urllist = ['/site_media/Imagedir/%s' % url for url in allimg]
return render_to_response('picture_display.html',
{'allimg': allimg})
But this also seems not very promising, since I want to display images, audio, media from one directory on multiple sites.
I hear paginator could be the solution.
So now my question:
What is the best, easiest and robust solution to display media in django in development and in production?
What are you using?
Please help me out!
Thanks for the time.