Django’s FastCGI init.d script for Linux

Posted by guille on Jan 12th, 2007 | 6 Comments Django’s FastCGI init.d script for Linux Thumbnail

Update 15 Jan 2007: I have updated the post as I’ve found a better implementation of this script. Indeed, in my previous solution I was running the server as root. Now I’ve simplified the script, eliminated the wrapper and I’m running my servers as a different user (www-data in my case).
In the constant search for [...]

XSS in my search function

Posted by guille on Nov 28th, 2006 | 0 Comments XSS in my search function Thumbnail

I got inspired from the search function of the admin interface  in order to do mine. I got so inspired that it’s actually a simplified version
People in the mailing list have asked about such a function for their own code, and I have shared my search function with them.
Well… i am ashamed to [...]

Improved poll application in Django

Posted by guille on Nov 7th, 2006 | 0 Comments Improved poll application in Django Thumbnail

One of the most basic and emblematic applications of Django is the poll application. Indeed, hundreds of djangoist have past through the tutorial at least once.
Being a tutorial example application it has some shortcomings. The main one, and the one that will be addressed here is how to avoid visitors voting more than once?
There is [...]

Django deployement on a personal server

Posted by guille on Nov 2nd, 2006 | 2 Comments Django deployement on a personal server Thumbnail

I have discussed in a previous post how my server was organized. I will discuss now how my Django web pages are organized.
When I started Django, I realized that one of the power of this framework was it’s flexibility. You could put your site on-line in 1000 different ways. But this flexibility (and lack of [...]

Comment and Karma functions in the Django framework

Posted by guille on Oct 21st, 2006 | 14 Comments Comment and Karma functions in the Django framework Thumbnail

Someone contacted me concerning a previous post I did on this blog. He could not make work the karma part, and had some strange errors.
My problem was, I did not actually implement anything of what I wrote about, so I took the code of my blog and started modifying it. And I made it work.
The [...]

First poll

Posted by guille on Oct 5th, 2006 | 0 Comments First poll Thumbnail

I’ve closed my first poll today, and I am proud to announce that Django is, by 100%, considered as the best web framework in the world!
Ok… the fact that only 6 people answered might be a hint of how serious the poll might have been. The fact that there’s only private and django posts in [...]

About the utility of a common repository of models in Django

Posted by guille on Sep 27th, 2006 | 2 Comments About the utility of a common repository of models in Django Thumbnail

In the Django mailing-list archive there has been at several occasions a thread about the creation of a public repository. Now, after several tries, it seems that this might be done in not too long. It is a good thing.
But what about models? Django is mainly database driven. Yes, you can run it without a [...]

Django Comments framework

Posted by guille on Sep 14th, 2006 | 5 Comments

I am writing this mainly for personal use and future reference, so
please excuse any lack of order or clarity. I will do my best to avoid
those.
The Comments framework is probably one of the least documented parts of
Django, but one with evident utility. It is made of two subparts, the
FreeComments and Comments part. For the first [...]

How to use CheckboxSelect MultipleField

Posted by guille on Sep 12th, 2006 | 0 Comments How to use CheckboxSelect MultipleField Thumbnail

I was actualy surprised not to find much information about the CheckboxSelectMultipleField. They simply say it is supposed to work like Select MultipleField but with checkboxes. It does, after you prepare() it
Indeed, the SelectMultipleField gives back a request.POST that looks like this: {‘classes’: ['First', 'Second', 'Third']} while the CheckboxSelectMultipleField gives back a request.POST [...]

Wrapping generic views

Posted by guille on Sep 12th, 2006 | 2 Comments Wrapping generic views Thumbnail

After programing a simple application with the generic views (create_object and update_object), I was faced with the following demand: A client wanted to use checkboxes instead of the standard select list Django offers when using generic views. Surprisingly enough, this option does not seem to be shipped as an option in the generic views.
The main [...]

© 2006,2007,2008,2009,2010 Guillermo Fernández Castellanos | Header images by Nick Lobeck