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: django

Django: Creating multiple select checkboxes with Forms

I got stuck for almost an hour trying to create a multiple select checkbox. Here is how to do it: First, I put this in my forms.py class UserlistForm(forms.Form): users = forms.MultipleChoiceField(widget=forms.CheckboxSelectMultiple,label="Notify and subscribe users to this post:") Then in … Continue reading

Posted in General | Tagged , , , , | 3 Comments

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

File Streaming in Django (Sending large files through Django)

I am planning to build something involving serving large files over HTTP. Putting the files in a public accessible directory is not an option since I need to monitor the users who download the file. Users will need to login … Continue reading

Posted in General | Tagged , , , | 3 Comments

Django and jQuery AJAX

This is probably my first post for Django. I have only been using it for a few weeks and I am already falling in love with it. Here is how to do an AJAX “save” using jQuery and Django. My … Continue reading

Posted in General | Tagged , , , | Leave a comment