A web developer's blog. PHP, MySQL, CakePHP, Zend Framework, Wordpress, Code Igniter, Django, Python, CSS, Javascript, jQuery, Knockout.js, and other web development topics.

Tag Archives: xsendfile

Django: Reading an image outside the public accessible directory and displaying the image through the browser

In some cases you would want to have “private” images for your logged-in users, you will not be able to store the images in the public accessible directory. For example, if you have “my_private_photo.png” stored in your normal “images” directory, … Continue reading

Posted in General | Tagged , , | 1 Comment

Apache mod_xsendfile for my Django app (UPDATED)

Here is how to setup/install mod_xsendfile in Apache2 + Django (mod_wsgi). First do this to install apxs2 $> sudo apt-get install apache2-prefork-dev Download mod_xsendfile: http://tn123.ath.cx/mod_xsendfile/ Install it by doing this: $> apxs2 -cia mod_xsendfile.c If you get an error compiling … Continue reading

Posted in General | Tagged , , , | 2 Comments