rohit
Comments
Reactions

Aren't django signals a little like comefrom?

By : rohit


In computer programming, COMEFROM (or COME FROM) is an obscure control flow
structure used in some programming languages, primarily as a joke.

I never liked using signals. Recently I was asked that, and has no answer, but a little thinking led me to this question. Aren't signals a little like COMEFROM. If yes, aren't they as bad as COMEFROM? If you do not know what a COMEFROM is, [wikipedia to the rescue](http://en.wikipedia.org/wiki/COMEFROM)

Some hypothetical code using COMEFROM, again from wikipedia,

from goto import comefrom, label
comefrom .repeat
name = raw_input('what is your ...

more info..
Topics : django rambling
shabda
Comments
Reactions

On Captcha

By : Shabda Raaj

When building public facing websites, spam is a real problem. Captcha has been teated as the first line of defence aginst this problem. If you must use captcha, here are some best practices working with them.

Can you do without one?

A lot of places captcha's are put to filter spam in user generated comment. One of the largest sources of UGC is comments on wordpress blogs. They do not use a captcha, and instead pass all comments through Akismet to verify which comments are spam, and reject the spams. In many cases, such a system would work for ...

more info..
Topics : tips
rohit
Comments
Reactions

Fun with none

By : rohit

(If you are in a hurry, here is the fun part.;) A few days ago, I was working with a nullable field, which wasn't behaving as I expected. So I started a shell, and see how nulls compare.

In [1]: None
In [2]: None > 10
Out[2]: False
In [3]: None < 10
Out[3]: True
In [4]: None == None
Out[4]: True
Funny, not as I expected. (Why is None < 10 True. I thought it would be either False or None or cause an Error?) So python is obviously broken, next steps, see the same thing in some other ...

more info..
shabda
Comments
Reactions

Django design patterns

By : Shabda Raaj

This is announcement about our new work, Django design patterns, a ebook about, well, Django design patterns. (Well imagine that!). Here is the readme copied from there.


[Edit] Syntax highlighting and indentation preservation were totally brroken. Fixed now.


Django design patterns is a book about commonly occuring patterns in Django. Not patterns in Gof sense, but patterns in the sense, we work this way, and it works for us. For us it is a ~pattern of work~ sense.

At this point this is just a lot of brain dump from us.

The latest sources are always available from http://github ...

more info..
Topics : django tips book

Remote debugging - debugging pesky server only bugs

By : Shabda Raaj

Here is a quick tip. (Obvious if you work with Django for any length of time, but I have seen a few people who are not aware)

You can put debug trace import pdb; pdb.set_trace() in your code, and put it on the server. When you access this view from your local browser, the debug is still hit and you have a debug shell on your server where you can step through. (Obviously this works only if you ran the code via manage.py runserver. But manage.py runserver start the server to listen only on local connections. If ...

more info..
Topics : django tips
© Agiliq, 2009-2012